Hi, I am working on a wordpress site (samsalesman.com) and need to align the page titles such as the following site: (kohayoga.org) I tried many things both on the header.php file and stylesheet but no success, does anybody have an idea on how to do this?
Heading elements are an inline element so you need to wrap it into a div block and create a class that aligns to the center, i.e. <div class="center"> <h1>Foo Title</h1> </div> # style.css .center { text-align: center } or you could convert the h1 tag to a block with a width etc but that is a little more complicated. Hope that helps...
You should close in a div and make a class and tlign ur text in center <div class="center"> <h1>Your text</h1> <h2>Your text</h2></div> # style.css .center { text-align: center } or may b this will help u .aligncenter, div.aligncenter { display: block; margin-left: auto; margin-right: auto; } .alignleft { float: left; } .alignright { float: right; } .wp-caption { border: 1px solid #ddd; text-align: center; background-color: #f3f3f3; padding-top: 4px; margin: 10px; /* optional rounded corners for browsers that support it */ -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .wp-caption img { margin: 0; padding: 0; border: 0 none; } .wp-caption p.wp-caption-text { font-size: 11px; line-height: 17px; padding: 0 4px 5px; margin: 0; }
If you want to align container with text, pictures and whatever else use this code: <div style="margin: 0 auto; width:900px;"> your text, pictures, etc. </div> Code (markup): 900px is width of the container that will be centered on the page. Best wishes!
Dude, if you are complete beginner take few tutorials before saying that it doesn't work. This is code of container from that Yoga website #container { margin:15px auto 0; width:970px; } Code (markup): few nested divs, with main container with id="container"