在我有文本的内部,p标记也在div标记的内部,我需要tex响应。
这是我的html和css代码
<div class="row">
<div class="col-md-4">
<div id="box4">
<p><a href="#" class="texto4">Brigadistas</a></p>
</div>
</div>
<div class="col-md-4">
<div id="box5">
<p><a href="#" class="texto5">Copasst</a></p>
</div>
</div>
<div class="col-md-4">
<div id="box6">
<p><a href="#" class="texto6">Normatividad</a></p>
</div>
</div>
</div>
#box4 p a{
text-align: center;
position: relative;
width: 100%;
bottom: 63px;
left: 57px;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 20px;
color: white;
}
#box5 p a{
text-align: center;
position: relative;
width: 100%;
bottom: 63px;
left: 57px;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 20px;
color: white;
}
#box6 p a {
text-align: center;
position: relative;
bottom: 63px;
left: 57px;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 20px;
color: white;
}
当浏览器调整大小时,p标记中的文本在div之外。
我用宽度:100%但什么也没发生。
这是我的截图
最佳答案
问题解决了。谢谢!我用了%
#box4,#box5,#box6{
width: 60%;
background:rgba(43,86,162,1.00);
margin-top:34%;
padding-top: 34%;
margin-bottom: 14%;
position: relative;
left:24%;
border-radius:12%;
border:5px solid rgb(178,205,73);
}
#box4 p a{
text-align: center;
position: absolute;
width: 100%;
bottom: 33%;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 140%;
color: white;
}
#box5 p a{
text-align: center;
position: absolute;
width: 100%;
bottom: 33%;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 140%;
color: white;
}
#box6 p a {
text-align: center;
position: absolute;
width: 100%;
bottom: 33%;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 140%;
color: white;
关于html5 - 如何在p标签内创建响应文本,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46355837/