Jump to content

Cascading Style Control


Chikwado

Recommended Posts

Some one check this: How to control style in my webpage, Example: The style properties I made in navigation bar, The style on hyper link spread to every hyperlink in mywebpage. I need to control it. Some tutorials said that I need to add . . .

!important
or
nochange
some one help.
Link to comment
Share on other sites

You should try to give the outer containers an unique id ref, example id="header" for header, id=" left-sidebar" for left column, id="menu-top-left-whatever" for specific menu and so on. Then by prefixing to the links selector the id ref, it will have precedence over the normal styling of links wether placed above or below the normal link styling.

Link to comment
Share on other sites

if you want to use one css file, You could use classes in order to give defferent style in every one class

you mean that I will have to add class to <a> tag, For example:
<a class="control" href=
"stuff.html">Some Stuff</a>
am I correct this way? More help.
Link to comment
Share on other sites

/*default*/a {color: #333;font-size:1.1em;}a:hover{color: red; text-decoration: none; font_weight: bold;}a:visited {color: lime; font-weight: bolder;}/* target using id ref of specific container */#left-sidebar a {color: blue; }/* color will be blue but font-size will remain the same*/#left-sidebar a:hover {color: #fff; text-decoration: underline;}/* color, underline changed but font weight remains same*/
Link to comment
Share on other sites

No, this example seem to be different with what I am planning to do. I have found the answer, This is what I did:

<a href="test.html" target="blank">
Then to style it:
a[target] { style properties here}
Although I have 10 hyperlink in my navigation bar. That "a[target]" will grab all of them as far they has attribution as target. Then after footer I have summary which is like navigation bar. I managed to style them this way:
<a href="text.html"  target="blank">
Then to style it;
a[target=blank]{ style properties here}
If you pay attention on this style, you will understand that a lot of tricks was made there. Edited by Chikwado
Link to comment
Share on other sites

Oh sorry! I didn't realize you are using frames, cause that is the only reason you would use this method of using target. The normal method would be to use my example or class reference, that way with addition classes you can make slight change and use elsewhere, without duplicating the whole code again, as you can only have only a single ref using target attribute, but since you are obviously using iframes/frame, you can see why i made the mistake, and you are right i should pay more attention. But! There again maybe you should pay attension and follow our examples, instead of dismissing and looking elsewhere and finding a example you actually got to work which is most likely to became problematic in the future.

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...