This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-03-25 17:42:47

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Html4

I am making a webpage with HTML4 and was wondering if anyone could answer this question:

What is the use of ID in CSS (#) when you could easily use CLASS (.) ?

Thank you!

Last edited by KrIsMa (2013-03-25 17:42:56)


http://blocks.scratchr.org/API.php?user=KrIsMa&action=onlineStatus&online=http://i49.tinypic.com/2pzic0m.png&offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#2 2013-03-25 17:44:20

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Html4

An ID is used for something that is unique and it's used mainly with Javascript for selecting the content or modifying an object.


Posts: 20000 - Show all posts

Offline

 

#3 2013-03-25 17:46:06

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

veggieman001 wrote:

An ID is used for something that is unique and it's used mainly with Javascript for selecting the content or modifying an object.

but can't you use an open selection like .warning {css blah}?


http://blocks.scratchr.org/API.php?user=KrIsMa&action=onlineStatus&online=http://i49.tinypic.com/2pzic0m.png&offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#4 2013-03-25 17:46:48

jackrulez
Scratcher
Registered: 2009-08-01
Posts: 1000+

Re: Html4

Dude.
HTML5 is the future. Why are you using HTML4? :/


Yawn, another boring text signature. I should really make something better.

Offline

 

#5 2013-03-25 17:48:23

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

jackrulez wrote:

Dude.
HTML5 is the future. Why are you using HTML4? :/

cause i like deprecated attributes cause i am style free XD

plus, i have a image free browser.

Last edited by KrIsMa (2013-03-25 17:48:32)


http://blocks.scratchr.org/API.php?user=KrIsMa&action=onlineStatus&online=http://i49.tinypic.com/2pzic0m.png&offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#6 2013-03-25 17:49:03

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Html4

KrIsMa wrote:

veggieman001 wrote:

An ID is used for something that is unique and it's used mainly with Javascript for selecting the content or modifying an object.

but can't you use an open selection like .warning {css blah}?

There's a specific function in Javascript, getElementById("elementid"), to get an element by its #elementid. There's also getElementsByClassName, but that gets an array.

jackrulez wrote:

Dude.
HTML5 is the future. Why are you using HTML4? :/

That's beside the point.

Last edited by veggieman001 (2013-03-25 17:49:23)


Posts: 20000 - Show all posts

Offline

 

#7 2013-03-25 17:51:45

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

veggieman001 wrote:

KrIsMa wrote:

veggieman001 wrote:

An ID is used for something that is unique and it's used mainly with Javascript for selecting the content or modifying an object.

but can't you use an open selection like .warning {css blah}?

There's a specific function in Javascript, getElementById("elementid"), to get an element by its #elementid. There's also getElementsByClassName, but that gets an array.

jackrulez wrote:

Dude.
HTML5 is the future. Why are you using HTML4? :/

That's beside the point.

oh cool thank you!

since we are on the topic html, what is the cascading part of CSS anyways?


http://blocks.scratchr.org/API.php?user=KrIsMa&action=onlineStatus&online=http://i49.tinypic.com/2pzic0m.png&offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#8 2013-03-25 17:51:56

jackrulez
Scratcher
Registered: 2009-08-01
Posts: 1000+

Re: Html4

veggieman001 wrote:

jackrulez wrote:

Dude.
HTML5 is the future. Why are you using HTML4? :/

That's beside the point.

Sorry, it's just that HTML5 is so much better. I mean, if you've already got the entire webpage in HTML4 already, go right ahead, but...


Yawn, another boring text signature. I should really make something better.

Offline

 

#9 2013-03-25 17:53:59

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

jackrulez wrote:

veggieman001 wrote:

jackrulez wrote:

Dude.
HTML5 is the future. Why are you using HTML4? :/

That's beside the point.

Sorry, it's just that HTML5 is so much better. I mean, if you've already got the entire webpage in HTML4 already, go right ahead, but...

KrIsMa wrote:

cause i like deprecated attributes cause i am style free XD

plus, i have a image free browser.


http://blocks.scratchr.org/API.php?user=KrIsMa&action=onlineStatus&online=http://i49.tinypic.com/2pzic0m.png&offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#10 2013-03-25 17:54:40

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Html4

jackrulez wrote:

Dude.
HTML5 is the future. Why are you using HTML4? :/

I use XHTML 1.0 (the XML version of HTML4) because it is more compatible with older browsers and the syntax isn't sloppy.

The reason you use an ID is to identify a specific element and saying it's unique. For example, setting the ID of the header <div> to "header" makes more sense than using class, because there's only one header <div>.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#11 2013-03-25 17:55:49

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

jackrulez wrote:

veggieman001 wrote:

jackrulez wrote:

Dude.
HTML5 is the future. Why are you using HTML4? :/

That's beside the point.

Sorry, it's just that HTML5 is so much better. I mean, if you've already got the entire webpage in HTML4 already, go right ahead, but...

I don't even know what the module thingamajig is!


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#12 2013-03-25 17:56:51

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

jvvg wrote:

jackrulez wrote:

Dude.
HTML5 is the future. Why are you using HTML4? :/

I use XHTML 1.0 (the XML version of HTML4) because it is more compatible with older browsers and the syntax isn't sloppy.

The reason you use an ID is to identify a specific element and saying it's unique. For example, setting the ID of the header <div> to "header" makes more sense than using class, because there's only one header <div>.

oh so it reduces confusion - and makes things unique?
thanks!

Last edited by KrIsMa (2013-03-25 17:58:58)


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#13 2013-03-25 19:38:15

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

I have a question, what is the cascading part in CSS?


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#14 2013-03-25 21:23:22

Laternenpfahl
Scratcher
Registered: 2011-06-24
Posts: 1000+

Re: Html4

KrIsMa wrote:

I have a question, what is the cascading part in CSS?

Inline Styles take priority over stylesheet styles, which take priority over user agent stylesheet (standard) styles/


http://i46.tinypic.com/6yd4c0.png

Offline

 

#15 2013-03-25 22:37:17

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

Laternenpfahl wrote:

KrIsMa wrote:

I have a question, what is the cascading part in CSS?

Inline Styles take priority over stylesheet styles, which take priority over user agent stylesheet (standard) styles/

hmm, whats a user agent stylesheet?
Is it the paragraph things (<h1>)?

Last edited by KrIsMa (2013-03-25 22:37:42)


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#16 2013-03-26 10:13:39

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Html4

KrIsMa wrote:

Laternenpfahl wrote:

KrIsMa wrote:

I have a question, what is the cascading part in CSS?

Inline Styles take priority over stylesheet styles, which take priority over user agent stylesheet (standard) styles/

hmm, whats a user agent stylesheet?
Is it the paragraph things (<h1>)?

Isn't that simply the code in a .css doc a writer creates?


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#17 2013-03-26 13:37:30

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Html4

mythbusteranimator wrote:

KrIsMa wrote:

Laternenpfahl wrote:


Inline Styles take priority over stylesheet styles, which take priority over user agent stylesheet (standard) styles/

hmm, whats a user agent stylesheet?
Is it the paragraph things (<h1>)?

Isn't that simply the code in a .css doc a writer creates?

No, a user agent stylesheet is the default stylesheet of your user agent (usually a browser)


Posts: 20000 - Show all posts

Offline

 

#18 2013-03-26 14:50:21

jackrulez
Scratcher
Registered: 2009-08-01
Posts: 1000+

Re: Html4

KrIsMa wrote:

jackrulez wrote:

veggieman001 wrote:


That's beside the point.

Sorry, it's just that HTML5 is so much better. I mean, if you've already got the entire webpage in HTML4 already, go right ahead, but...

KrIsMa wrote:

cause i like deprecated attributes cause i am style free XD

plus, i have a image free browser.

Sorry, I really need to read backwards in the topic.


Yawn, another boring text signature. I should really make something better.

Offline

 

#19 2013-03-27 13:40:17

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

veggieman001 wrote:

mythbusteranimator wrote:

KrIsMa wrote:


hmm, whats a user agent stylesheet?
Is it the paragraph things (<h1>)?

Isn't that simply the code in a .css doc a writer creates?

No, a user agent stylesheet is the default stylesheet of your user agent (usually a browser)

So like <h1> elements are being controlled by user agent style sheets by default? Sorry I just jumped into HTML!


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#20 2013-03-27 14:27:49

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Html4

KrIsMa wrote:

veggieman001 wrote:

mythbusteranimator wrote:


Isn't that simply the code in a .css doc a writer creates?

No, a user agent stylesheet is the default stylesheet of your user agent (usually a browser)

So like <h1> elements are being controlled by user agent style sheets by default? Sorry I just jumped into HTML!

<h1> are automatically a default setting (for example, 30px font, Angelica, black, etc.) (which can be changed if you change the fonts), but you can edit it with the ".h1" class in CSS.


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#21 2013-03-27 14:47:39

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

mythbusteranimator wrote:

KrIsMa wrote:

veggieman001 wrote:


No, a user agent stylesheet is the default stylesheet of your user agent (usually a browser)

So like <h1> elements are being controlled by user agent style sheets by default? Sorry I just jumped into HTML!

<h1> are automatically a default setting (for example, 30px font, Angelica, black, etc.) (which can be changed if you change the fonts), but you can edit it with the ".h1" class in CSS.

Yes thank you!  smile
Does that mean the user agent style sheets control these headings by default?


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#22 2013-03-27 15:01:48

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Html4

KrIsMa wrote:

mythbusteranimator wrote:

KrIsMa wrote:


So like <h1> elements are being controlled by user agent style sheets by default? Sorry I just jumped into HTML!

<h1> are automatically a default setting (for example, 30px font, Angelica, black, etc.) (which can be changed if you change the fonts), but you can edit it with the ".h1" class in CSS.

Yes thank you!  smile
Does that mean the user agent style sheets control these headings by default?

Yes, however, if you change the default settings (size, color, font), the h1 will change.

You can edit it just by itself in CSS, for example, this is what I did:

.h1 {     /* For headers */
     font-size: 20px;
     color: #0B6138;
     font-family:"Times New Roman", Times, serif;
}

smile


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#23 2013-03-27 15:49:43

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Html4

mythbusteranimator wrote:

KrIsMa wrote:

mythbusteranimator wrote:


<h1> are automatically a default setting (for example, 30px font, Angelica, black, etc.) (which can be changed if you change the fonts), but you can edit it with the ".h1" class in CSS.

Yes thank you!  smile
Does that mean the user agent style sheets control these headings by default?

Yes, however, if you change the default settings (size, color, font), the h1 will change.

You can edit it just by itself in CSS, for example, this is what I did:

.h1 {     /* For headers */
     font-size: 20px;
     color: #0B6138;
     font-family:"Times New Roman", Times, serif;
}

smile

Actually, that should just be "h1" rather than ".h1", since it's the element rather than the class.


Posts: 20000 - Show all posts

Offline

 

#24 2013-03-27 17:43:34

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Html4

veggieman001 wrote:

mythbusteranimator wrote:

KrIsMa wrote:


Yes thank you!  smile
Does that mean the user agent style sheets control these headings by default?

Yes, however, if you change the default settings (size, color, font), the h1 will change.

You can edit it just by itself in CSS, for example, this is what I did:

.h1 {     /* For headers */
     font-size: 20px;
     color: #0B6138;
     font-family:"Times New Roman", Times, serif;
}

smile

Actually, that should just be "h1" rather than ".h1", since it's the element rather than the class.

Really? My HTML book says that .h1 applies this style sheet to all h1 elements.


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

#25 2013-03-27 17:55:07

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Html4

KrIsMa wrote:

veggieman001 wrote:

mythbusteranimator wrote:

KrIsMa wrote:

Yes thank you!  smile
Does that mean the user agent style sheets control these headings by default?

Yes, however, if you change the default settings (size, color, font), the h1 will change.

You can edit it just by itself in CSS, for example, this is what I did:


smile

Actually, that should just be "h1" rather than ".h1", since it's the element rather than the class.

Really? My HTML book says that .h1 applies this style sheet to all h1 elements.

That doesn't work.
In this example, if .h1 were applied to h1 elements, the header would be blue (because the latest instruction takes precedence).


Posts: 20000 - Show all posts

Offline

 

Board footer