Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Centre a div

Status
Not open for further replies.

GRIFFIJ

Programmer
Aug 29, 2002
43
GB
Hi ya

I know this is a really silly question but I have a div inside a div tag that holds a countdown clock I am trying to centre the div inside the div.

Example

The container div is call is "countdownclock inside that div is a div called "daysBox".

I am trying to centre the "daysBox" inside the "ountdownclock" so it is centred to the left.

}
#countdownclock {
padding: 5px;
height: 56px;
width: 980px;
margin-right: auto;
margin-left: auto;
margin-top: auto;
margin-bottom:auto;
border-width: 2px;
border-style: solid;
}
#daysBox {
vertical-align:auto;
height: 42px;
width: 105px;
margin-right: auto;
margin-left: auto;
border-width: 1px;
border-style: solid;
font-size: 44px;

}
Thanks Joel
 
Thank you, how do you make it left align?
 
1. How is this Javascript related?

This is just CSS. forum215

2. Creating new threads instead of answering the questions in the previous ones you've made, makes it hard to follow.

3. Technically the CSS you have there should center the daysbox div inside the countdownclock div which itself is also centered inside its container. Unless you have other CSS being applied, or your ID's do not match correctly.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top