Jump to content

Upload code


SpOrTsDuDe.Reese

Recommended Posts

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

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

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

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

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

would the body part of that css code be applied to the <body> tag? same with the <form> tag?
Yes
also how does apple add the dropshadow effect to their search field?
Background-image on the input field
would 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 style
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"
Well we had a student teach us Flash in year 10 IT class :)
Link to comment
Share on other sites

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

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

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

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

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 FF
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.
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

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 FF
Oh right. Don't delete its folder in the "Program Files" section though!
Link to comment
Share on other sites

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

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

<div class="asdf"> is for #asdf right?<div id="fdsa"> is for .fdsa
An 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...