Reputation: 27
I am writing a page in HTML and CSS. Inside the page, I have several div
tags that I want to center on the page. I have wrapped them all in a div
tag with the class infogroup
. Then, to my CSS, I added this code: .infogroup{text-align: center;}
. It does not center the text in my browser (google chrome), but it does in jsfiddle. I am wondering why I am having this error, and what to do about it. The page has been tested locally and on a server, and has the trouble with both. The page live:
Thank you!
-Ty
HTML
<!DOCTYPE html>
<html>
<head>
<title>bridgeOrTunnel</title>
<link rel="stylesheet" type="text/css" href="bot.css">
</head>
<body>
<header><img src="botlogo.png"></header>
<div class="infogroup">
<div id="line1">
<span class="image"><img src="bri.png"></span>
<span class="image"><img src="tun.png"></span>
</div>
<div id="line2">
<span class="time">9 minutes</span>
<span class="time">13 minutes</span>
</div>
<div id="line3">
<span class="lanes">3 lanes open</span>
<span class="lanes">5 lanes open</span>
</div>
<div id="line4">
<span class="cost">$1.39</span>
<span class="cost">$4.27</span>
</div>
</div>
</body>
Upvotes: 0
Views: 72
Reputation: 4354
you forgot to include this in your bot.css
.infogroup{
text-align: center;
}
Upvotes: 1