PDA

Click to See Complete Forum and Search --> : CSS Question


JoshT
Jan 5th, 2001, 11:49 AM
How would I get H1 width to be the size of the text it contains. Right now, using IE5.5, the text is centered but the white box its in takes up 100% of the screen width. I could say width:500; or something but that's not too efficient.


<style type="text/css">
<!--
body {
text-align: center;
font-family: Arial;
background: black;
}
a:hover {
color: red;
}
h1 {
background: white;
color: black;
}
-->
</style>


Thanks,
Josh

Jan 9th, 2001, 11:42 AM
How about something like this:


<H1 ALIGN="center"><B STYLE="{ background-color: C0C0C0; color: 000000; }">Hello World!</B></H1>


It does the background coloring using a tag embedded in the H1 and limits the extent of the coloring.

Paul

JoshT
Jan 10th, 2001, 06:46 AM
I'm using a global style sheet so I can change the style of about 30 ASP-dynamically-generated pages all at once, so that is about the same as using the
<h1><span>Something</span></h1>
I came up with and setting the <span> tag in the stylesheet.

Thanks,
Josh