gpt4 book ai didi

css - 如何在 Bootstrap 的背景图片中添加文字?

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

我正在设计 Bootstrap 表单。我想像这样在背景图片中添加文本:http://dubaiexporters.com/member_benefits.aspx .我尝试了下面的代码,但文本在背景图像中不合适。

enter image description here

我是 Bootstrap 的新手。

代码:

<div class="container">
<div class="silverAds">
<div class="adContent">
<ul><li><a href="pdf/Dubai_Exporters_Member_Certficate.pdf" target="_blank">DubaiExporters Membership Certificate </a></li>
<li>Log in to access and edit the Company profile. </li>
<li>Access to the latest inquiries received from agents, importers, distributors all
over the world.</li>
<li>Company’s Logo , profile & the website link in the Supplier’s section.</li>
<li>Advertisement of the Company shall be included in the Listing.</li>
<li>Weekly Newsletter updates from Dubai Exporters containing latest news about the
world economy, export scenarios, upcoming projects, trade events, market reviews
and the link to the Member’s Profile on Dubai Exporters, shall be mailed to our
entire database of over 150000 Importers from Africa, CIS,Eastern Europe, latin
America, Asia.&nbsp;<a class="lightbox" href="images/newslettertemplate.jpg">View sample</a></li>
<li>A CD of Dubai Exporters shall be distributed to all the trade visitors and importers
visiting Int’l trade exhibitions where Dubai Exporters participates, thereby making
your company’s information reach the right target audience. </li>
</ul>
<div style="float: right; padding:15px 60px 0px 0px;">
<asp:ImageButton ID="btSilver" runat="server" ImageUrl="images/mem_btn.png"
/></div>
</div>
</div>
</div>

CSS:

 .silverAds
{


background: url( 'images/SILVER-member.jpg' ) no-repeat center 0;
height: 372px;
width: 50%;
margin: 0px 0px 20px 0px;
width:100%;
}

.adContent
{
padding:80px 80px 0px 65px;
width:87%;
}

div.adContent li
{

font-family :Arial;
font-size: 12px;
list-style-image: none;
color:#FFFFFF;
line-height:16px;

}
div.adContent li a{color:#FFFFFF; text-decoration:underline;}

最佳答案

使用 background-size: 100% 100%;height: 100%;

参见 fiddle :https://jsfiddle.net/5shda4pc/2/

 .silverAds
{
background-image: url('https://material.angular.io/assets/img/examples/shiba1.jpg');
height: 100%;
margin: 0px 0px 20px 0px;
width:100%;
background-repeat: no-repeat;
background-size: 100% 100%;
}

.adContent
{
padding:80px 80px 0px 65px;
width:87%;
}

div.adContent li
{

font-family :Arial;
font-size: 12px;
list-style-image: none;
color:#FFFFFF;
line-height:16px;

}
div.adContent li a{color:#FFFFFF; text-decoration:underline;}
<div class="container">
<div class="silverAds">
<div class="adContent">
<ul><li><a href="pdf/Dubai_Exporters_Member_Certficate.pdf" target="_blank">DubaiExporters Membership Certificate </a></li>
<li>Log in to access and edit the Company profile. </li>
<li>Access to the latest inquiries received from agents, importers, distributors all
over the world.</li>
<li>Company’s Logo , profile & the website link in the Supplier’s section.</li>
<li>Advertisement of the Company shall be included in the Listing.</li>
<li>Weekly Newsletter updates from Dubai Exporters containing latest news about the
world economy, export scenarios, upcoming projects, trade events, market reviews
and the link to the Member’s Profile on Dubai Exporters, shall be mailed to our
entire database of over 150000 Importers from Africa, CIS,Eastern Europe, latin
America, Asia.&nbsp;<a class="lightbox" href="images/newslettertemplate.jpg">View sample</a></li>
<li>A CD of Dubai Exporters shall be distributed to all the trade visitors and importers
visiting Int’l trade exhibitions where Dubai Exporters participates, thereby making
your company’s information reach the right target audience. </li>
</ul>
<div style="float: right; padding:15px 60px 0px 0px;">
<asp:ImageButton ID="btSilver" runat="server" ImageUrl="images/mem_btn.png"
/></div>
</div>
</div>
</div>

关于css - 如何在 Bootstrap 的背景图片中添加文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51165909/

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