CSS? or not? (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


moondog -> CSS? or not? (6/23/2005 14:53:28)

I saw a webpage that has the links sitting as standard text, with no underline or color variation, however, when you hover over the links, they become underlined. I viewed the source code and there is a section in the "html" called <style type="text/css"> so I believe this to be CSS, but I have tried to copy and paste this into a new page, but I do not get the same effect. What am I doing wrong?

moondog




BobbyDouglas -> RE: CSS? or not? (6/23/2005 15:08:13)

Hey moondog,

A URL would help us answer your question.




moondog -> RE: CSS? or not? (6/23/2005 15:12:33)

Hi Bobby, I don't actually have the URL, I have the page, with the script on it now. can I get that to you somehow?

dog




bobby -> RE: CSS? or not? (6/23/2005 15:47:27)

yes, you would use CSS to do that...

You can define the behavior of the <a> tag with font color, background color, border, background images, text-decoration (underline) etc

An example of what you're seeing as it might appear in the .css file:

a:link, a:visited {
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

a:active {
text-decoration: none;
}






d a v e -> RE: CSS? or not? (6/23/2005 16:06:35)

this is a good place for more info as well
http://www.w3schools.com/css/default.asp and outfront's own tut's http://www.outfront.net/tutorials_02/adv_tech/css1.htm




bobby -> RE: CSS? or not? (6/23/2005 16:34:41)

W3Schools is the perfect first stop for digging into CSS

This forum is the perfect second stop.

[;)]




jaybee -> RE: CSS? or not? (6/23/2005 16:58:04)

quote:

I have tried to copy and paste this into a new page, but I do not get the same effect


Have you just copied the style info into a new page without the rest of the HTML?

The style info contains tags which will be referred to elsewhere in the HTML code and cause those elements to behave in a certain way.

If they are standard tags such as those defined by Bobby above then you're OK but if they're user defined codes then they won't work.

Copy your code and when you get the Reply to Message box up on here you'll see a <% in the toolbar at the top.
click on that then place your cursor in between the [ code ] and the [ /code ] boxes and click paste. Then submit and we can take a look at what you've got.




bobby -> RE: CSS? or not? (6/23/2005 17:13:52)

quote:

<style type="text/css">

This by itself does nothing... there will be more to the stylesheet

[;)]




moondog -> RE: CSS? or not? (6/23/2005 18:18:46)

Here is the script as it is on the page that works. Yet when I put it in the script on the page I want it to work in, it doesn't work. Is there someplace special I need to insert this?
<style type="text/css">






a.NavLinks:active {font-family:Arial,Helvetica;font-size:9pt;font-weight:normal;font-style:normal;text-decoration:none;color:#000000;}






a.NavLinks:visited {font-family:Arial,Helvetica;font-size:9pt;font-weight:normal;font-style:normal;text-decoration:none;color:#000000;}






a.NavLinks:link {font-family:Arial,Helvetica;font-size:9pt;font-weight:normal;font-style:normal;text-decoration:none;color:#000000;}






a.NavLinks:hover {font-family:Arial,Helvetica;font-size:9pt;font-weight:normal;font-style:normal;text-decoration:underline;color:#000000;}






td.MainBody {font-family:Arial;font-size:12pt;font-weight:normal;font-style:normal;text-align:justify;text-decoration:none;color:#000000;}






</style>




BobbyDouglas -> RE: CSS? or not? (6/23/2005 18:36:02)

quote:

Is there someplace special I need to insert this?

- Put this code between your <head> and </head> tags. Also make sure the links you want to have that effect on, use the class NavLinks.

So: <a href="somepage.html" class="NavLinks">Some Page</a>




moondog -> RE: CSS? or not? (6/23/2005 19:34:46)

Bobby,
Thanks....I THINK I have it now....and in the style section, to change the font, size, color, I just change that in the "NavLinks" lines? right?

dog




moondog -> RE: CSS? or not? (6/23/2005 19:40:12)

Bobby,
Another question concerning the "style" in the NavLinks section.....

font-family:Arial,Helvetica;

How do I determine the family for a font? On the pages I'm doing, I want to use Verdana font, but don't know what family it comes from....

dog




BobbyDouglas -> RE: CSS? or not? (6/23/2005 20:16:37)

Sorry, I thought I replied to this, but I guess I closed the window with the reply. So this will be short :)

The browser looks for the first font in the list, and if the person has it on their computer, it will display that font, else it moves on to the next font.

So font-family: Verdana, Arial, Helvetica; would show Verdana first, then Arial, then Helvectica, depending on what font the user has (it checks from left to right).

quote:

Thanks....I THINK I have it now....and in the style section, to change the font, size, color, I just change that in the "NavLinks" lines?

- Correct




bobby -> RE: CSS? or not? (6/24/2005 10:22:55)

Verdana is the family...

font-family is the same thing as saying "font-name"





moondog -> RE: CSS? or not? (6/24/2005 14:19:01)

Bobby,
Thanks a lot for all your help....it is never as hard as I make it out to be....but thanks for your patience and assistance. I have it working the way I want now....just need to finish all the pages and publish them.

dog




caz -> RE: CSS? or not? (6/24/2005 15:04:17)

To ensure that your site is viewed in the correct generic font family in the event of the named fonts not being available I always code like this:-

font-family: Verdana, Helvetica, Arial, sans-serif;

This ensures that a serif font is not the default chosen.




bobby -> RE: CSS? or not? (6/24/2005 15:43:23)

quote:

it is never as hard as I make it out to be


I'm familiar with that, LOL

there's always something new to learn. when you stop learning new things, that's when you die.

[;)]




dpf -> RE: CSS? or not? (6/24/2005 15:46:30)

quote:

when you stop learning new things, that's when you die.
..or signup for AOL




bobby -> RE: CSS? or not? (6/24/2005 16:12:40)

quote:

..or signup for AOL

No, if you've signed up for AOL then you still have at least one thing left to learn... [;)]




Tailslide -> RE: CSS? or not? (6/24/2005 16:22:39)

quote:

ORIGINAL: bobby

quote:

..or signup for AOL

No, if you've signed up for AOL then you still have at least one thing left to learn... [;)]


Yeah but unfortunately through that little AOL window - you're unlikely to ever learn it.




dpf -> RE: CSS? or not? (6/24/2005 16:58:43)

touche




bobby -> RE: CSS? or not? (6/24/2005 17:38:45)

... the day I have to go back to dial up is the day I give up on the Internet all together...

[:-]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125