CSS 中的图像方向和布局
如果这听起来不可能,请原谅我,我是 CSS 新手。我想做一个
我希望能够在 HTML 中做到这一点:
<div class='imagepanel1-2'> <img class='large' src='blahblah'> <img class='small' src='blahblah'> <img class='small' src='blahblah'> </div>
在 CSS 中,“大”和“小”子类将控制图像的宽度和高度,“imagepanel1-2”将控制方向。此外,面板中每个图像之间应该有 1 个像素的空白空间。我所描述的可能吗?
Forgive me if this sounds impossible, I am new at CSS. I want to make a <div> tag and give it a class of 'imagepanel1-2'. The point is to have 3 images in this panel: 1 large and 2 small (the 2 smalls would be stacked on each other just the right of the large one).
And I want to be able to do this in the HTML:
<div class='imagepanel1-2'> <img class='large' src='blahblah'> <img class='small' src='blahblah'> <img class='small' src='blahblah'> </div>
In the CSS the 'large' and 'small' subclasses would control the widths and heights of the images, and the 'imagepanel1-2' would control the orientation. Also, there should be 1 pixel empty space between each image in the panel. Is what I am describing possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为如果你为“小”和“大”类使用正确的CSS,这是可行的。至于方向,我不确定你的意思,但对于空间,你可以设置 div 的边距。
例如,您可以设置
“大”类、
“小”类和
“imagepanel 1-2”类。 (我还没有尝试过该代码。)
I think that it would be doable if you use the right css for the 'small' and 'large' classes. As for orientation I'm not sure what you mean, but for the space you can set the margin of the divs.
For example you can set
for the 'large' class,
for the 'small' class, and
for the 'imagepanel 1-2' class. (I haven't tried out the code yet.)