Jump to content

multiple CSS in one page


Aaron

Recommended Posts

Hi, I added an in page CSS to style the links on my fleet page, but when I do that it screws up the other links in the page. Also, in my pilot center, if I style a second side menu, it screws up the formatting of the top navbar. I've googled it and tryed everything I can think of

Link to comment
Share on other sites

<style type="text/css">
a:link {
color: #333333;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #333333;
}
a:hover {
text-decoration: none;
color: #999999;
}
a:active {
text-decoration: none;
color: #333333;
}
a {
font-size: 18px;
}
</style>

Heres what I have at the beggining. Below there is a table with links in it. It works with those ones perfectly fine, but it also affects other links on the page. The phpvms link at the bottom turns big and grey because the above code has priority over the external css. I read about all that on W3schools, but I cant figure out how to make internal code apply only to certain sections. Is it possible maybe to rename them to c:link, c:visited ... and then apply that to the table? If so what changes do I need in the table?

Link to comment
Share on other sites

<style type="text/css">
a:link {
color: #333333;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #333333;
}
a:hover {
text-decoration: none;
color: #999999;
}
a:active {
text-decoration: none;
color: #333333;
}
a {
font-size: 18px;
}
</style>

Heres what I have at the beggining. Below there is a table with links in it. It works with those ones perfectly fine, but it also affects other links on the page. The phpvms link at the bottom turns big and grey because the above code has priority over the external css. I read about all that on W3schools, but I cant figure out how to make internal code apply only to certain sections. Is it possible maybe to rename them to c:link, c:visited ... and then apply that to the table? If so what changes do I need in the table?

Don't use CSS like that, it's bad practice. You should try to keep it all in external css files. Also, no; you can't rename it to c. There is no such thing as a c tag. a is a specific tag (anchor) - just like p, i, b, u or div.

Link to comment
Share on other sites

Tom is correct. The "a" in this case, is pointing to a link (<a href="www.mylink.com"></a>). The HTML reading the css for "a" will be using what is in the css. You can only use functions that are recognized as Tom posted above. What you could do is create another css rule so a different link can follow it. I would recommend that you place this in a css file, and not your template.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...