PDA

View Full Version : css links and books


andy384
02-10-2006, 06:56 PM
I span all of my main text on my site in the p.content_text class. Whenever I put a link in the body the link inherits the properties of the nav div I am using. I have tried everything I can think of but it is still having this problem. I realize it is probably an easy solution, but I can't find my specific problem anywhere, it is driving me nuts!

Any help is appreciated.



Here is my CSS:


body
{
font-family: helvetica, arial, sans-serif;
font-size: 0.8em;
}
#container
{
width: 70%;
position: absolute;
margin-left: 15%;
margin-right: 15%;
}
#header
{
border-bottom: 1px solid #AAAAAA;
margin: 0.6em 0 0 0;
}

#nav
{
width: 15em;
margin: 1em 0 1em 0em;
padding: 0.5em 0 1em 0;
float:left;
clear: both;
border-right: 1px solid #AAAAAA;
}
#nav a, a:visited, a:active
{
display: block;
margin: 1.5em 0 0 0;
text-decoration: none;
font-size: 130%;
color: blue;
border-bottom: 1px solid #FFFFFF;
}
#nav span
{
color: #555555;
}
#nav a:hover
{
border-bottom: 1px solid #AAAAAA;
}
#content
{
margin: 1em 0 1em 15em;
padding: 1em 0 1em 1.5em;
border-left: 1px solid #AAAAAA;
}


#content span.content_title
{
display: block;
border: 1px solid #AAAAAA;
background-color: #F9F9F9;
padding: 0.2em;
margin: 0;
}

#content p.content_text
{
text-align:justify;
margin-left: 0.5em;
}

#content img.cut_left
{
float: left;
margin: 0 0.5em 0.5em 0;
}
#content img.cut_right
{
float: right;
margin: 0 0 0.5em 0.5em;
}
#footer
{
font-size: 80%;
border-top: 1px solid #AAAAAA;
text-align: center;
clear: both;
padding: 0.2em 0 0.2em 0;
}
#footer a
{
text-decoration:none;
font-size: 100%;
color:black;
}


[/code]

domedia
02-10-2006, 07:16 PM
You've actually set up your CSS to use the same style for navigation links as for all other links:
#nav a, a:visited, a:active
{
display: block;
margin: 1.5em 0 0 0;
text-decoration: none;
font-size: 130%;
color: blue;
border-bottom: 1px solid #FFFFFF;
}

Above you combine 3 declarations
1. All links inside #nav
2. All visited links
3. All active links

You probably want something like this:
#nav a, #nav a:visited, #nav a:active
{
display: block;
margin: 1.5em 0 0 0;
text-decoration: none;
font-size: 130%;
color: blue;
border-bottom: 1px solid #FFFFFF;
}
This will apply the CSS to all links, visited links and active links inside #nav

andy384
02-10-2006, 11:46 PM
Domedia thanks so much. I knew it was something simple. I was staring at forever and it wouldn't compute. Thanks a million.

:)

domedia
02-11-2006, 12:36 AM
No problem :)
CSS is my favorite kind of code, I love helping out on it.

andy384
02-11-2006, 01:16 AM
Hey domedia, just a random question, what would be your the #1 book you would recommend for a beginner/intermediate CSS user?

domedia
02-11-2006, 04:44 AM
Andy, kinda depends on how you're planning on using CSS.

Personally I don't like to think CSS only. I think the way you combine HTML and CSS, the structural and presentational layers of the website, is most important. A healthy semantical structure of your information is like candy for search engines in my experience, and makes styling (CSS) the information much more fun.
If that's what you're looking for I can fully recommend Web Standard Solutions by Dan Cederholm (http://www.dreamweaverclub.com/books/1590593812/Web_Standards_Solutions_The_Markup_and_Style_Handb ook_Pioneering_Series.html). One of the best web dev books I've read, but I haven't read that many.

If you feel your HTML skills are good, and you write your own HTML, I would recommend any of Eric Meyers books on CSS (http://www.dreamweaverclub.com/books/index.php?Operation=ItemSearch&Keywords=%22eric+meyer%22&SearchIndex=Books). Meyer has been in the front of developing CSS since it's inception, and is probably the biggest CSS guru there is ;)

But if you give some more info on exactly what kind of use of CSS you're looking for, I can give you better advise. If you're looking for Full CSS layout, I can't help you much.. There's 2 schools of thought, one using floated elements (me and few others) and those using positioning (the rest).
In fact I still do plenty of websites with the basic layout in tables (ie: one table with 2 columns) and all the rest are DIV's, and it's not that bad. Not perfect but often I can't justify using additional hours on behalf of client to come up with a 'cool' CSS layout.

andy384
02-11-2006, 04:11 PM
Thanks for the recommendations, I will check out Web Standard Solutions.

dthomsen8
02-14-2006, 02:14 PM
Elsewhere, I received a strong recommendation for a book on CSS by Bos & Lie. I will get the title if needed, but can you comment on it? My CSS books are 2 years old or more, and I know I need something better.

David

domedia
02-14-2006, 02:37 PM
Elsewhere, I received a strong recommendation for a book on CSS by Bos & Lie. I will get the title if needed, but can you comment on it? My CSS books are 2 years old or more, and I know I need something better.

David
http://www.dreamweaverclub.com/books/0321193121/Cascading_Style_Sheets__Designing_for_the_Web_3rd_ Edition.html
Lie is a fellow norwegian who actually invented CSS (well there were a couple of similar ideas at the time, but Haakons idea is the CSS we see today). I actually wrote a piece on the history of CSS about 2 years ago, but I can't find it now. Bos has been working with CSS since it was proposed as well.
I have *not* read this book, but based on who the authors are, it can't be that bad. The customer reviews on the link above seem to be really good as well, altough. It *seems* that this book takes you through all the CSS properties and gives some neat examples o how to use them.