- This topic is empty.
-
AuthorPosts
-
December 19, 2017 at 2:36 pm #264067LaszloParticipant
can’t remove my H1 link underline, please help :)
I tried writing text-decoration: none; in id# and .class as well, unfortunately, id didn’t work.please give me some ideas.
link https://codepen.io/Laszlo226/pen/dJMqLEDecember 19, 2017 at 11:53 pm #264075Paulie_DMemberYou’re using the
.h1
and.a
as selectors which are for classes.But you haven’t applied those classes. Use
h1
anda
(no preceding period/fullstop). Those are element selectors.December 19, 2017 at 11:56 pm #264076Paulie_DMemberYou also had a couple of other errors
li#nav
for instance instead of#nav li
December 20, 2017 at 7:00 am #264120LaszloParticipantThank you again for the help :)
December 20, 2017 at 7:10 am #264122LaszloParticipantOne more question #Paulie_D how do I make the h1 color black?
December 20, 2017 at 7:59 am #264124Paulie_DMemberIt’s automatically black (unless you have set some other color elsewhere)…however because the text is actually in a link it has default color imposed which are basically blue until changed.
So
h1 a {color:black;}
should work.December 20, 2017 at 12:45 pm #264141LaszloParticipantOne more thing I am trying to position a p element but first I want to make a border around it. border: 20px; is not working. Please help.
https://codepen.io/Laszlo226/pen/GyqORmDecember 21, 2017 at 9:41 am #264181ShikkedielParticipantThe shorthand border property needs three values – width, style and colour. You only have one.
December 21, 2017 at 9:46 am #264184Paulie_DMemberDidn’t I cover this already?
Oh, I did
It seems you aren’t paying attention.
Honestly, I think you really need to research more before using selectors and properties without knowing what they mean or how they work.
December 21, 2017 at 2:24 pm #264205KRoweDevParticipantPart of the reason that this is more difficult than it should be is that you aren’t using the semantically best tags. Header tags should be reserved for actual page headers. HTML 5 had a tag specifically for menus for a short time but that will not be making it to the final specification (so don’t use them if you find information about them while looking for examples on the web). For now, the best option is to use unordered lists. This won’t fix your color issue but it should reduce the amount of CSS you need to configure the other font settings. Your basic menu should look something like this:
<ul> <li><a href="item1.html">Item 1</a> <li><a href="item2.html">Item 2</a> <li><a href="item3.html">Item 3</a> </ul>
Your style definitions should look like this:
ul { list-style-type: none; margin: 0; padding: 0; width: 200px; background-color: #f1f1f1; } li a { display: block; color: #000; padding: 8px 16px; text-decoration: none; } /* Change the link color on hover */ li a:hover { background-color: #555; color: white; }
-
AuthorPosts
- The forum ‘Design’ is closed to new topics and replies.