- This topic is empty.
June 2, 2013 at 8:23 am #45159
Is there a way to give a border width to an element? I want a situation where a border-bottom will be shorter or longer than the element it is applied to. I tried border-width:100px, but it made the border to appear like a box. Is there a better way of doing it?June 2, 2013 at 8:29 am #137322AlenParticipant
you mean like:
border-bottom:100px solid #ccc;
}June 2, 2013 at 8:29 am #137323CrocoDillonParticipant
Only way is using a (pseudo)element, as `border-width` is the thickness of the border. Something like:
margin: 0 auto;
}June 2, 2013 at 9:55 am #137330June 2, 2013 at 10:02 am #137331June 2, 2013 at 10:08 am #137332June 2, 2013 at 10:15 am #137337
You aren’t making yourself clear then.
Do you want it longer, wider or taller?June 2, 2013 at 10:27 am #137335
longer.June 2, 2013 at 10:28 am #137336
Then the example I gave is fine…the border is longer than the text.June 2, 2013 at 10:38 am #137338
No. I want when u hover on ‘home’, it’s bottom border will stretch all the way to ‘contact’.
Then when u hover on ‘about’, starting from about text, it’s border will again stretch to contact. and so on.June 2, 2013 at 10:38 am #137339
Then when you hover on ‘contact’ itself, it’s bottom border will stretch back all the way to home.June 2, 2013 at 10:41 am #137340wolfcry911Participant
edit// I just saw your new posts. why didn’t you mention that to begin with, rather than have 3 people (if not more) waste time suggesting things you originally asked for but don’t want?
previous post// Dillon’s suggestion is still perfectly valid (as is Paulie’s with a different method); you stated ‘shorter or longer’ and Dillon gave you shorter. Just change the 80% to something greater than 100% if you want it longer.June 2, 2013 at 10:41 am #137341
Not sure what experience that would give to the user, confusing at best.
>Then when u hover on ‘about’, starting from about text, it’s border will again stretch to contact. and so on.
I think @wolfcry911 has gone about as far as css can take it.
To get what you want, I’m not sure CSS is the answer.
However, I re-iterate
>Not sure what experience that would give to the user, confusing at best.
- The forum ‘CSS’ is closed to new topics and replies.