SpOrTsDuDe.Reese Posted December 4, 2007 Share Posted December 4, 2007 hello im going through the tutorials at w3 and it never says specifically where i cna put css code.it says stuff you want to put styles on must be put in the head section (along with outside stylesheets)I would assume you put the css code (w/o styles, and w/o the outside stylesheets) in the body section?actually i think its the head section for everything now thinking about it...tell me k? Link to comment Share on other sites More sharing options...
Ingolme Posted December 4, 2007 Share Posted December 4, 2007 You can put it in the head in this form:<head><style type="text/css">p { color: green; }</style></head>Or in the body like this:<body><p style="color: green">Some text</p></body> Link to comment Share on other sites More sharing options...
Synook Posted December 5, 2007 Share Posted December 5, 2007 But it is invalid (though will render in most browsers) to put style tags in the body <body><!-- The following is invalid! --><style type="text/css"></style></body> Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 5, 2007 Author Share Posted December 5, 2007 so if i would to use css code, like long information of chunks..in the head section? Link to comment Share on other sites More sharing options...
Synook Posted December 7, 2007 Share Posted December 7, 2007 Yes. Or you can specify an external stylesheet using the <link> tag e.g. <link type="text/css" rel="stylesheet" href="stylesheet.css" /> Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 7, 2007 Author Share Posted December 7, 2007 also. for the <form> and <body> tagsif i would do... <style type="text/css><!--body{blah blah blah}form{blah blah blah}--></style> would the body part of that css code be applied to the <body> tag? same with the <form> tag?also how does apple add the dropshadow effect to their search field? ipod.com (it wil be in the top part. the text looks grey. i assume thats the dropshadow effect)would i put that in the form{blah blah blah} part? or would i assign classes to the search field and use.searchfielddropshadow effect?im a newb so not sure of what i said is true or not. this information ive learned entirely in 30 minutes. im a junior in a class where we learn CSS and my teacher knows i like making websites and he made a joke where he siad "ok you can teach the CSS part haha" but i know he's serious cause hes stupid. so i have to learn as much as i can quickly Link to comment Share on other sites More sharing options...
Synook Posted December 8, 2007 Share Posted December 8, 2007 would the body part of that css code be applied to the <body> tag? same with the <form> tag?Yesalso how does apple add the dropshadow effect to their search field?Background-image on the input fieldwould i put that in theform{blah blah blah} part?or would i assign classes to the search field and use.searchfielddropshadow effect?You would apply it to the input field's stylewhere we learn CSS and my teacher knows i like making websites and he made a joke where he siad "ok you can teach the CSS part haha"Well we had a student teach us Flash in year 10 IT class Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 10, 2007 Author Share Posted December 10, 2007 well all the information that ive posted in this forums, has been learned by me in a short while of time. ok thanks for all the help man. i think that with all ive learned from this (ive studied all this weekend (css)) i think i can teach the class now. but if i assigned a class to a search field and then used.searchfield blah blah balhthat would work right? Link to comment Share on other sites More sharing options...
Synook Posted December 11, 2007 Share Posted December 11, 2007 Yes. A brief overview may be element.class > direct-child[attribute="value"], element#id child + co-worker:pseudo-class { property:value;} Some of those don't work in IE 6. Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 11, 2007 Author Share Posted December 11, 2007 well i hate IE and microsoft. i feel asif the only good thing microsoft has ever created is XP. even vista was a mistake. i just erased IE off my computer. MFF all the way. im not familiar with pseudo-class's. brief overview please? what cna they do for me.also for code like this.. #Container { position:absolute; left:185px; top:42px; width:630px; height:239px; the #container. would i use a <div id="container>blah container pixel codes</div> ?would the div use the code from the first box? Link to comment Share on other sites More sharing options...
Synook Posted December 11, 2007 Share Posted December 11, 2007 You can't erase IE... or else how do you use Explorer? im not familiar with pseudo-class's. brief overview please?Pseudo-classes are like :hover (when the mouse is over it) :click (when the mouse is down). These work in IE. However ther are also pseudo-elements such as :before (before the element) and :first-line (the first line). These don't work in IE. Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 12, 2007 Author Share Posted December 12, 2007 You can't erase IE... or else how do you use Explorer? What I mean is I deleted IE off my desktop and erased it everywhere I normally go. I use Mozilla FFPseudo-classes are like :hover (when the mouse is over it) :click (when the mouse is down). These work in IE. However ther are also pseudo-elements such as :before (before the element) and :first-line (the first line). These don't work in IE.So pseudo-classes can be used along with CSS links to...add some special effects to whatever you select?That's basically what I'm getting from this. What kind of effects are possible with pseudo-classes? Link to comment Share on other sites More sharing options...
Synook Posted December 13, 2007 Share Posted December 13, 2007 Well, you know how in many sites when you roll over a link, it changes color etc? You can do that with :hover a {color:#333333;}a:hover {color:#999999;} What I mean is I deleted IE off my desktop and erased it everywhere I normally go. I use Mozilla FFOh right. Don't delete its folder in the "Program Files" section though! Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 13, 2007 Author Share Posted December 13, 2007 I know, my brother did that, and I couldn't see the desktop or start menu or anything until I did system restore lol.Ok..<div class="asdf"> is for #asdf right?<div id="fdsa"> is for .fdsa and pseudo elements are a wise choice for CSS. Also how do you know...for example a {color:[b]#333333;[/b]}a:hover {color:[b]#999999;[/b]} What code you use to generate there to get your color? Do you just keep guessing at numbers? I know #FFFFFF is white. Any clues for me as to how you remember the HTML code numbers? Link to comment Share on other sites More sharing options...
Synook Posted December 14, 2007 Share Posted December 14, 2007 They are in hexadecimal notation, as #RRGGBB, so FF = 255 = Brightest / Most, 00 = 0 = Darkest / Least, so #0000FF = Bright Blue, #FFFF00 = Lots of Red + Lots of Green + No Blue = Bright Yellow, #0066FF = Some Green + Lots of Blue = Bluish Cyan, etc. Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 18, 2007 Author Share Posted December 18, 2007 Makes sense to me. Thanks. Link to comment Share on other sites More sharing options...
elementalgrace Posted December 19, 2007 Share Posted December 19, 2007 <div class="asdf"> is for #asdf right?<div id="fdsa"> is for .fdsaAn id is represented as # and a class as a . so you have them the wrong way round in your example.<div class="asdf"> would refer to .asdf in the CSS<div id="fdsa"> would refer to #fdsa in the CSSRemember that you can use a class multiple times on a page, but you can only use the id once. Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 19, 2007 Author Share Posted December 19, 2007 Lol, I meant that but I just typed that wrong. MB Link to comment Share on other sites More sharing options...
justsomeguy Posted December 20, 2007 Share Posted December 20, 2007 Also, it's not valid to put HTML comments inside a CSS file. CSS are comments are enclosed in C-style block comments /* comment */. You can learn more about selectors here, including pseudo-classes and pseudo-elements:http://www.w3.org/TR/CSS21/selector.html Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 20, 2007 Author Share Posted December 20, 2007 Oh, I thought I did it correctly. I know about the validation with HTML comments, Those were just for me to tell me what attributes were assigned to what. Link to comment Share on other sites More sharing options...
elementalgrace Posted December 21, 2007 Share Posted December 21, 2007 What code you use to generate there to get your color? Do you just keep guessing at numbers? I know #FFFFFF is white. Any clues for me as to how you remember the HTML code numbers?Download ColorPad - http://www.webmasterfree.com/ColorPad_d7705.html it's a really handy little tool and it's free. Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted December 21, 2007 Author Share Posted December 21, 2007 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.