PDA

View Full Version : Quick Semantics Question...


Ben@WEBProp
08-14-2003, 05:00 PM
These may seem easy to you pros, but I can't find this answer anywhere!

Alright, so I am using the "outdated" <small> tag in one of the pages that I am updating. I want to keep the same effect in an external style sheet, but how do I come about this? Is there a replacement for the <small> tag? What is the correct semantic solution for this?

Thanks!

-Ben

brothercake
08-14-2003, 05:14 PM
you can go

font-size:smaller;

or just give that paragraph or whatever a smaller font size.

Ben@WEBProp
08-14-2003, 09:36 PM
Thanks for that last one, it helped alot!

But I got another for ya, probably equally as simple, but definatly equaly as difficult for me to find an answer for!

I have an external style sheet with pretty much two types of paragraph styles. One of these is used pretty much everywhere, while the second is used for 1 type of page.

Lets say the first is
p.normal {
font-family: verdana,helvetica,sans-serif;
font-size: 12pt;
color: #000000;
margin-left: 205px
}

and the second is
p.second {
font-family: arial;
font-size: smaller;
color: #000000;
margin-left: 100px
}

Still with me? Alright, so lets say I put p.normal {} to just p {}. What will be the inheritance for a paragraph with class="second"?

I don't know if my question is very clear, so it is basically this:

With those 2 styles in my .css file, what will a class="second" paragraph look like and which style overides the other?

Thanks!

-Ben

giz
08-14-2003, 10:47 PM
Ah, that will be the cascade part of the Cascading Style Sheets.

Let's see if we can find you a relevant page at http://w3.org/ or at http://w3schools.org/ ....

MotherNatrsSon
08-14-2003, 11:02 PM
Originally posted by giz
Ah, that will be the cascade part of the Cascading Style Sheets.

Let's see if we can find you a relevant page at http://w3.org/ or at http://w3schools.org/ ....

How about this one??

http://www.w3.org/TR/CSS2/cascade.html

MNS

Ben@WEBProp
08-14-2003, 11:08 PM
Oh! There it is MNS! I saw that before but when I went back I couldn't find a correct link. Thanks for the pointer!

What do you guys think of W3C's navigation...I can never find what I want! They are the figurehead of the correct page types, but I still can't find what I need half the time!

Oh well, maybe it's just me:o .

Thanks again!

-Ben

Ben@WEBProp
08-15-2003, 12:40 AM
Ok, here is another:

In my textual tooltip script, an id="descriptions" inside a <div> is called for in a Javascript to make the entire effect happen. There is no style data for the id yet, it is used merely as a reference. I have a font styling for it and I want to know how I should implement it css wise.

Options:

1) Give the <div> both a class="" and an id="descriptions" value. Define the class="" in the .css file. Question: Can I have both a class= and an id= for one div?

2) Make div#descriptions{} in my external style sheet to control the text. Question: will this mess with my Javascript at all?

This is the script:

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
appear()
setTimeout("window.onresize=regenerate",450)
}
}

function changetext(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById? document.getElementById("descriptions"):document.all.descriptions
cross_el.innerHTML='<font face="Verdana"><small>'+whichcontent+'<font></small>'
}
else if (document.layers){
document.d1.document.d2.document.write('<font face="Verdana"><small>'+whichcontent+'</small></font>')
document.d1.document.d2.document.close()
}
}
function appear(){
document.d1.visibility='show'
}
window.onload=regenerate2
//-->

Which solution should I do? Any other suggestions?

cheesebag
08-15-2003, 01:42 AM
1) Yes.
2) No.

Use id as a selector if the style is unique to that element, and class if an already declared class will do.

http://www.webreference.com/html/tutorial5/6.html

brothercake
08-15-2003, 12:11 PM
remember IDs must be unique - you can't have more than one element with the same ID

cheesebag
08-15-2003, 05:21 PM
From that link:If you assign an element an ID attribute, you single it out in a document; you have effectively given it a name. This is why it is not allowed to have more than one ID attribute in your document with the same value. Since the value of the ID attribute uniquely identifies an element, it would be wrong to give more than one element the same ID.A posted link is part of the answer...:rolleyes:

Ben@WEBProp
08-15-2003, 11:36 PM
Thanks, you cleared that one up for me very quickly!

Ok, rather than starting a new thread, I will continue this one...

I know that target="_blank" opens a link into a new window, but how do you make that window that pops up maximize automaticly? Is this done with HTML, CSS, Javascript?

Thanks!

-Ben

MotherNatrsSon
08-15-2003, 11:41 PM
I think target="_blank" opens a window the same size as the current window in a users browser. It is not the same as a "pop-up".

MNS

AaronW
08-16-2003, 12:08 AM
I'd tell you how to open a window maximized, but doing so would be going against everything I believe in :p

When someone closes a window that's been maximized via script, any subsequent windows they open will be maximized, but technically just sized to fill the screen, not really "maximized". This is just a pain because to get windows to open small again, you have to open a browser window, size it as needed manually, then close the browser, and reopen.

Never fun.

swmr
08-16-2003, 06:42 PM
how do you make that window that pops up maximize automaticly?

function search(){var query = maximize} (http://codingforums.com/search.php?action=showresults&searchid=156603&sortby=&sortorder=) :D