這可能是一個簡單的問題。我有一個背景顏色的標題文本。文本停止時背景顏色停止。我想要背景填充容器的整個長度。橫跨集裝箱拉伸的文字背景
<body>
<div class="container">
<p><span style="color:#ffffff; font-size:30px; background-color:#e12025;">I want the background- color stretched across the container</span>
</div>
</body>
CSS:
body {
background-color:#e12025;
align:center;
font-family:sans-serif;
color:#000000;
font-size:28px;
}
.container {
background-color:#ffffff;
position:relative;
margin-left:auto;
margin-right:auto;
height:1785px;
width:900px;
border-style:none;
padding:10px;
}
下面是一個例子:http://mm2.co/background-color