Page 1 of 1
align text in <h1> >> help !
Posted: Mon Jun 30, 2008 1:33 pm
by Monopoly
Well , maybe this may sound stupid , but how can you align text in <h1> , I mean to have a couple of aligns in the same <h1>.
Example:
<h1><left>text on left</left><right>text on right</right> </h1> Something like this , you got me
Thank you
Re: align text in <h1> >> help !
Posted: Mon Jun 30, 2008 2:11 pm
by califdon
Monopoly wrote:Well , maybe this may sound stupid , but how can you align text in <h1> , I mean to have a couple of aligns in the same <h1>.
Example:
<h1><left>text on left</left><right>text on right</right> </h1> Something like this , you got me
Thank you
You shouldn't be using a single html element, like <h1>, if you want different alignments. You should use CSS, something more like this:
Code: Select all
...
<style type="text/css">
div.L {
clear:left;
float:left;
text-align:left;
}
div.R {
float:right;
text-align:right;
}
</style>
</head>
<body>
...
<div class="L">Text on left</div><div class="R">Text on right</div>
Re: align text in <h1> >> help !
Posted: Mon Jun 30, 2008 2:25 pm
by matthijs
califdon is right. that's why I said in my earlier reply that the method you choose depends on the situation. If it's a small part of a title I want to align, I might use the positioning technique. If it's about multiple columns and boxes, you'd use floated divs.
If you really want to learn this I can recommend to study a book or two about CSS. Maybe "cascading style sheets" by brigs et al. It would really help to understand the basics first.