gpt4 book ai didi

html - margin 不起作用。有人可以检查我的代码并帮助我吗?

转载 作者:行者123 更新时间:2023-11-28 15:12:57 25 4
gpt4 key购买 nike

我想对齐一个 div 中心内的所有 div。所以我给外部 div 留边距但边距不起作用。我不知道是什么问题。我也给宽度...给 float 是问题。我读到边距有 float 和宽度的问题。是这个问题吗??

* {
margin: 0px;
padding: 0px;
}

#products_main {
clear: both;
margin: 50px:;
}

.product_item {
clear: both;
}

.product_item_image {
float: left;
}

.product_item_content {
float: left;
width: 65%;
font-size: 200%;
align: justify;
}

.product_item_heading {
width: 75%;
color: #06F;
}
<body>
<div id="products_main">
<div id="products">
<div class="product_item">
<div>
<h2 class="product_item_heading">
Industrial Automation
</h2>
</div>
<div class="product_item_image">
<img src="images/products/Industrial automation/images/Oscillator.jpg" width="350" height="200">
</div>
<div class="product_item_content">
Oscillators:Quartz crystal Oscillators,crystal resonators,Oscillator modules
</div>
</div>
</div>
</div>
</body>

最佳答案

只需删除 margin:50px: ; 中 50px 后的冒号 : 即可!

关于html - margin 不起作用。有人可以检查我的代码并帮助我吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47882959/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com