Home >
Web Front-end >
HTML Tutorial >
My css code is as follows. Why does the read image only have one per line? Can there be three per line and the fourth line is wrapped_html/css_WEB-ITnose
My css code is as follows. Why does the read image only have one per line? Can there be three per line and the fourth line is wrapped_html/css_WEB-ITnose
WBOY
Release: 2016-06-24 12:22:26
Original
2308 people have browsed it
My css code is as follows. Why does the read image only have one image per line, and the second one will wrap to the next line? How can I modify it so that there are three per line, and the fourth one will wrap.
In addition, margin:10px auto sets the distance from the top of the table to 10px. How can I set the distance from the left side of the table to 10px as well.
The distance displayed in this way is still some distance from the left.
< ul id="products"> {maccms:vodpagelist num=20 type=current by=time order=desc}
<style type="text/css"> <!-- * { margin:0; padding:0; font-size:12px; text-decoration:none; } #products { width:500px; margin:10px auto; } #products li { width:20px; height:24px; float:left; margin-left:5px; display:inline; } #products li a { display:block; } #products li a img { border:1px solid #666; padding:1px; } #products li span a { width:110px; height:30px; line-height:24px; text-align:center; white-space:nowrap; text-overflow:ellipsis; overflow: hidden; } --> </style>
Copy after login
In addition margin:10px auto The distance from the top of the table is set to 10px. How can I set the distance from the left side of the table to 10px as well.
margin-top : 10px; margin-left:10px;
li float The number displayed in each line is related to the width of the window. If you want to control the number displayed in each line, is it just Can I use Table?
I have a width of 500, which is enough to display three columns. These codes are placed in a table.
Thank you, 10px from the left has been implemented, but there is only one image in each line, and the second one will wrap to the next line. How should I adjust the code?
I have a width of 500, which is enough to display three columns. These codes are placed in a table.
Look at the width of your table TD But I don’t see the TABLE element in the code
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn