Results 1 to 3 of 3

Thread: CSS Question

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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.

    Code:
    <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

  2. #2
    Guest
    How about something like this:

    Code:
    <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

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width