SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    there is no box baztorres's Avatar
    Join Date
    May 2004
    Location
    UK - London \ Surrey
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Internal style sheet query \ confusion

    Hello,

    I'd been trying to get a font to work using an internal style sheet when it was placed in the body tag and it didn't want to. So, I then decided to place it in a wrapping div and then it worked.

    Why would this have happened?

    cheers
    Baz
    ---

  2. #2
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    this is how you do fonts in a internal style sheet

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    	<title>12345 12345 12345 12345 12345 </title>
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    	<style type="text/css">
    	body{
    	font-family:"Monotype Corsiva",Verdana, Arial, Geneva, Helvetica, sans-serif;
    	font-size:2em;
    	color:#00008b;
    	text-align:center;
    	}
    	</style>
    </head>
    <body>
    font by CSS
    </body>
    </html>

  3. #3
    there is no box baztorres's Avatar
    Join Date
    May 2004
    Location
    UK - London \ Surrey
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, my post was crap. I know how to place the font in an internal style sheet. I want to know why it worked when placed in a div and not in the body tag.
    Baz
    ---

  4. #4
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    your example please,

    My example now its not valid html but this seems to work in the body and div
    in all browsers

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    	<title>12345 12345 12345 12345 12345 </title>
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    
    </head>
    <body>
    
    <div>
    	<style type="text/css">
    	body{
    	font-family:"Monotype Corsiva",Verdana, Arial, Geneva, Helvetica, sans-serif;
    	font-size:2em;
    	color:#00008b;
    	margin-top:1em;
    	text-align:center;
    	}
    	</style>
    	font by CSS
    </div>
    
    </body>
    </html>
    Last edited by all4nerds; Jun 6, 2005 at 06:20.

  5. #5
    there is no box baztorres's Avatar
    Join Date
    May 2004
    Location
    UK - London \ Surrey
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the code

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
    
    <html>
    <head>
    
    <title>Title</title>
    
    <style type="text/css">
    
    \\TAGS
    body {
    
    	background-color:#ffffff;
    }
    
    #wrapper {
    	position:relative;
    	top:-15px;
    	width:550px;
    	font-family: Arial, Helvetica, Sans-Serif;
    	font-size:12px;
    }
    
    </style>
    
    <body>
    
    <div id="wrapper">
    Text text text text text text text text text text text text text text
    </div>
    
    </body>
    </html>

    The font defining will not work when it is placed in the body rules in the style.
    I know it should work, but, it doesn't want to.

    So I just want to know why...
    Baz
    ---

  6. #6
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    and what is this \\TAGS ??

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That should work (if you remove the \\TAGS thing), unless there are other rules that you're not showing us.
    Birnam wood is come to Dunsinane

  8. #8
    there is no box baztorres's Avatar
    Join Date
    May 2004
    Location
    UK - London \ Surrey
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, confused on how to do comments....

    Cheers
    Baz
    ---

  9. #9
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    /* comments in css sheet */

  10. #10
    there is no box baztorres's Avatar
    Join Date
    May 2004
    Location
    UK - London \ Surrey
    Posts
    372
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers
    Baz
    ---


Bookmarks

Posting Permissions

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