简体   繁体   English

如何创建侧面(左侧或右侧)具有适当间距的图像

[英]How can I create an image with text on the side (left or right) with proper spacing in between

How can I copy the layout of this page? 如何复制此页面的布局?

I want to have an image with text on the right side of it but has to have a small space between them so they don't look too crowded and an image with text on the left. 我想在图像的右侧有一个图像,但是它们之间必须有一个很小的空间,这样它们才不会显​​得太拥挤,而在图像的左侧则是文本。 See sample page attached. 请参见所附的示例页面。

[Image] -space- [Text ]
[Text ] -space- [Image]
[Image] -space- [Text ]

Image With Text Page 带文字页面的图像

This a link only answer, because the link describes it perfectly: 这是一个仅答案的链接,因为该链接完美地描述了它:

https://www.w3schools.com/Css/css_float.asp https://www.w3schools.com/Css/css_float.asp

The examples use CSS 'Flow' to flow the image left or right . 这些示例使用CSS'Flow 'Flow' left right图像。

You can then use CSS margin or padding to create a distance between text and image. 然后,您可以使用CSS marginpadding来创建文本和图像之间的距离。

Hi please use the power of flex for the equal size and spacing between the content.flex is very handy and easy to use. 嗨,请使用flex的力量使内容之间的大小和间距相等。flex非常方便且易于使用。 I hope it will work for you. 希望它对您有用。

You can use the .my-space-between class for margin . 您可以将.my-space-between类用于margin。

 .myflex{display:flex; justify-content:space-between; } .my-inner-item div{flex:1; } .my-space-between{flex:.1; } 
 <div class="myflex"> <div class="my-inner-item">my image will be here </div> <div class="my-space-between"></div> <div class="my-inner-item">my text will be here</div> </div> <div class="myflex"> <div class="my-inner-item">my image will be here </div> <div class="my-space-between"></div> <div class="my-inner-item">my text will be here</div> </div> <div class="myflex"> <div class="my-inner-item">my image will be here </div> <div class="my-space-between"></div> <div class="my-inner-item">my text will be here</div> </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何将一个div分为两个,用于在左侧显示文本,在右侧显示图像 - how i can divide one div on two, for display text on left, and image on right side 如何在 rmarkdown 演示文稿中包含左侧图像和右侧文本 - How to include image on left side and text on the right side for rmarkdown presentation 如何在html中显示图像以及左侧和文本右侧 - how to display image and left side and text right side in html 如何创建左侧图像和右侧内容 - how to create left side image and right side content 如何对这个 HTML 表的定位进行排序? - 我需要右侧的提交按钮,需要删除左侧的间距 - How can I sort the positioning of this HTML Table? - I need the Submit button on the right hand side and need to remove the spacing on the left 如何删除 div 左侧的空白间距? - How can I remove the empty spacing on the left side of my div? 如何删除右侧的间距? - How can I remove the spacing on the right-side? 如何将“X”按钮移动到右侧的末尾(与文本左侧对齐)? - How can I move the 'X' button to the end of the right side(inline with the left side of text)? 如何将左侧的所有文本和右侧的图像对齐 - how to align all text on left side and image on right size 如何使导航栏居中,但在左右两侧保持均匀的间距? - How do I center the nav bar, but keep even spacing on the left and right side?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM