- This topic is empty.
-
AuthorPosts
-
November 20, 2014 at 9:03 pm #188864
Doodayer
ParticipantHow would i go about changing the value of the border in this:
nav li a { display: block; font-family: 'Alegreya Sans SC', sans-serif; font-weight: 700; text-decoration: none; height: 30px; /* set a height */ line-height: 30px; /* vertically align the text */ padding: 0 15px; /* breathing room */ background-color: #333333; color:#ffffff; }
inside of this:
nav li #faq:hover { background-color:#FF4747; }
?
thanks!
November 21, 2014 at 2:06 am #188868itsLeon
ParticipantWhat border?
November 21, 2014 at 6:19 am #188881Doodayer
Participantits not inside of that one, it was just an example
November 21, 2014 at 6:34 am #188883Paulie_D
MemberYour question is about changing a border value…presumably on hover…but you don’t have a border in your code.
How are we supposed to know what it is you are trying to do…we’re not psychic!?
If you have a problem…demo the problem…help us help you.
November 21, 2014 at 9:26 am #188910Doodayer
Participantall in need to know how to do really is change any css values inside a different bit of css.
November 21, 2014 at 9:37 am #188914Paulie_D
Memberall in need to know how to do really is change any css values inside a different bit of css.
I have no idea what that means.
Change what values…when?
November 21, 2014 at 9:56 am #188919Doodayer
Participantso if i have
<li>
id=”a” and another with id=”b”i want to change the css of #a, inside of #b
li #a { some css; } li #a { change that some css inside #a; }
November 21, 2014 at 10:08 am #188922Paulie_D
MemberWe obviously have a language barrier.
What is the relationship of
#a
to#b
?What would cause the CSS to change?
November 21, 2014 at 11:55 am #188932jpistolas
ParticipantNot sure of what you want to do, but if its adding a border, try this:
border: 1px solid #000;
example:
nav li #faq:hover {
background-color:#FF4747;
border: 1px solid #000;
}November 21, 2014 at 11:58 am #188933Doodayer
Participant#a and #b have no relation other than they are both links in the navigational bar.
So if i have this bit of code
nav li #a:hover { border: 1px solid #000; }
how can i take this
nav li #b:hover { }
and change the value of #a’s border inside of #b?
November 21, 2014 at 12:29 pm #188935jpistolas
ParticipantMaybe they want to change borders on hover state and don’t know how to add them to the entire list of anchor tags????
Total guess,
http://codepen.io/anon/pen/XJJoMMNovember 21, 2014 at 12:45 pm #188937Doodayer
Participantexactly so inside of this
.nav li a { float:left; height:50px; width:50px; padding:10px; background-color:#f00; border: 2px solid #ff0; } .nav li a:hover #a{ border: 2px solid #000; }
how can i change the border value of
.nav li a { float:left; height:50px; width:50px; padding:10px; background-color:#f00; border: 2px solid #ff0; }
inside of
.nav li a:hover #a{ border: 2px solid #000; }
or if i have multiple like
.nav li a:hover #a{ border: 2px solid #000; } .nav li a:hover #b{ border: 2px solid #000; } .nav li a:hover #c{ border: 2px solid #000; }
November 21, 2014 at 12:58 pm #188939jpistolas
ParticipantNot sure if this is what you’re asking for, but try this:
http://codepen.io/anon/pen/EaaGQwNovember 21, 2014 at 5:58 pm #188963Doodayer
Participantok closer, but what if there was a border surrounding the container. and then inside of each
.nav li a:hover#a { border: 2px solid #000; } .nav li a:hover#b { border: 2px solid #0f0; } .nav li a:hover#c { border: 2px solid #90f; }
instead of changing their border, they changed their containers border
November 22, 2014 at 1:24 am #188966Paulie_D
MemberChild elements cannot affect parent (container) elements in CSS.
For that you need javascript.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.