[英]Stop text wrapping around image
->请添加以下HTML和CSS代码
->在img标签中设置图像路径
@media (max-width: 767px) { .image, .text { clear: both; } }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1" /> <title> stop text wrapping around image </title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div class="image"> <img src="file-path/test.jpg" align="left" class="ms" alt="image"/> </div> <div class="text"> <span class="ms">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span> </div> </body> </html>
您必须为移动屏幕尺寸(<768像素)编写css,为图像的宽度样式设置值100%。 示例,根据上面的代码:
@media(max-width:768px){
.text {
width: 100%;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.