hena Posted September 11, 2015 Share Posted September 11, 2015 hi all, i am new to developing, i am trying to develop a site with the help of googling. In my header title, its not aligning to center even if i give the property text-align:center #header { clear:both; height:110px; background-color:#fff; }#site_title { float: left; margin: 25px 0 0 405px; }#site_title h2 { margin: 0; padding: 0; color:#000; } waiting for the valuable inputs Link to comment Share on other sites More sharing options...
dsonesuk Posted September 11, 2015 Share Posted September 11, 2015 Since we have no html to work with, i'll just guess that the header is in the floated element, this element will shrink to content forcing it left. Link to comment Share on other sites More sharing options...
hena Posted September 11, 2015 Author Share Posted September 11, 2015 Since we have no html to work with, i'll just guess that the header is in the floated element, this element will shrink to content forcing it left. <div id="header"><!--starts of header--> <div id="site_title"> <h2>'IMPROVING HSE AT HOME'</h2> <img class="image_wrapper image_fr" src="images/Logo_lockup.jpg" alt="image" /><br><br><br> </div></div> <!-- end of header --> Link to comment Share on other sites More sharing options...
dsonesuk Posted September 11, 2015 Share Posted September 11, 2015 Looks like i was right! Mind you the massive left margin fixed width won't help either. This will cause a off centre container element and therefore an off centre header title. 1 Link to comment Share on other sites More sharing options...
hena Posted September 11, 2015 Author Share Posted September 11, 2015 Looks like i was right! Mind you the massive left margin fixed width won't help either. This will cause a off centre container element and therefore an off centre header title. thanku for ur inputs. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now