- This topic is empty.
-
AuthorPosts
-
July 22, 2013 at 2:08 am #143963Historical Forums UserParticipant
<p>Hey, I am trying to create a drop down menu, and I have put link tags around each of the list items. But I am having trouble placing link tags around the list items with an unordered list nested in it without making everything within it the same link. I know I could just put link tags around the text to solve my problem, but I would prefer it if it was around the list items themselves.</p>
<p>Here’s my pen: http://codepen.io/anon/pen/rwLbg</p>
<p>(I want to put links round the photos and videos tab).</p>
<p>Thank you.</p>
- This topic was modified 10 years, 8 months ago by Historical Forums User.
July 22, 2013 at 2:11 am #143964AnonymousInactive<p>The only direct children of unordered lists that are allowed are list items.</p>
<p>You can put pretty much anything inside an li though</p>
July 22, 2013 at 2:15 am #143968Historical Forums UserParticipant<p><</p>
<p>p>Sorry, the link to CodePen was empty:</p>
<!DOCTYPE html>
<p><html>
<head>
<link rel=”stylesheet” type=”text/css” href=”navbar.css”/>
<title></title>
</head>
<body><a href="#">Home</a> <!--I want a link around the photos list item-->Photos <a href="#">People</a> <a href="#">Animals</a> <a href="#">Landmarks</a> <!--I want a link around the videos list item-->Videos <a href="#">Amateur</a> <a href="#">Professional</a> <a href="#">Forums</a>
</body>
</html></p>
- This reply was modified 10 years, 8 months ago by Historical Forums User.
- This reply was modified 10 years, 8 months ago by Historical Forums User.
- This reply was modified 10 years, 8 months ago by Historical Forums User.
- This reply was modified 10 years, 8 months ago by Rob MacKay.
- This reply was modified 10 years, 6 months ago by Rob MacKay.
July 22, 2013 at 2:20 am #143971AnonymousInactive<p>The forums are having trouble with formatting at the moment.</p>
<p>Here’s a link to the ‘standard menu structure</p>
<p>Link</p>
July 22, 2013 at 2:24 am #143973Historical Forums UserParticipant<p><</p>
<p>p>That is what I wrote in my pen, but I wanted the link tags to go round the list tags, not the text. So: http://codepen.io/A73X4ND3R/pen/akHrg</p>
- This reply was modified 10 years, 8 months ago by Historical Forums User.
- This reply was modified 10 years, 8 months ago by Historical Forums User.
- This reply was modified 10 years, 8 months ago by Historical Forums User.
July 22, 2013 at 2:31 am #143979AnonymousInactive<p>You can’t put links around list items…it’s not allowed.</p>
July 22, 2013 at 2:32 am #143980Historical Forums UserParticipant<p>I changed the pen you sent to me with the word link as the link. Look at it.</p>
- This reply was modified 10 years, 8 months ago by Historical Forums User.
July 22, 2013 at 2:33 am #143981AnonymousInactive<p>However, if you don’t want the list items “Photos” etc to be links then just omit the link tag.</p>
<p>Does that achieve what you are after?</p>
July 22, 2013 at 2:35 am #143983AnonymousInactive<p>Like this</p>
<p>Link</p>
July 22, 2013 at 2:35 am #143984Historical Forums UserParticipant<p>no, I do want them to be links. I changed your pen you previously submitted, you’ll see what I mean there.</p>
July 22, 2013 at 2:40 am #143985AnonymousInactive<p>I’m really having trouble understanding what it is you are trying to do.</p>
<p>Lists (ul) (ol) etc can ONLY contain list items (li) and NOTHING ELSE.</p>
<p>You can put anything you want inside a list item (links or not).</p>
<p>If you want a list item to be a link…put an anchor link INSIDE it…if you don’t it will stay as plain text.</p>
July 22, 2013 at 2:52 am #143987Historical Forums UserParticipant<p>How do I upload an image? Because my pen isn’t working.</p>
- This reply was modified 10 years, 8 months ago by Historical Forums User.
- This reply was modified 10 years, 8 months ago by Historical Forums User.
- This reply was modified 10 years, 8 months ago by Historical Forums User.
July 22, 2013 at 3:11 am #143992AnonymousInactive<p>If you have WEB link to an image you can add it using an image tag…</p>
<p>EDIT…just everything is screwed at the moment.</p>
September 27, 2013 at 2:43 am #143991Historical Forums UserParticipant<pre class=”codepen” data-height=”300″ data-type=”html” data-href=”hnpoq” data-user=”A73X4ND3R” data-safe=”true”>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="navbar.css"/>
<title></title>
</head>
<body><a href=""#"">Home</a> <!--I would like to put a link around the Photos list item, but I can't without adding a link to all the links nested in it--> Photos <a href=""#"">People</a> <a href=""#"">Animals</a> <a href=""#"">Landmarks</a> <!--I would like to put a link around the Videos list item, but I can't without adding a link to all the links nested in it--> Videos <a href=""#"">Amateur</a> <a href=""#"">Professional</a> <a href=""#"">Forums</a> <!------------------------------The reason I want anchor tags around the list item is so, when it is a navigation bar, you can click on the tab itself, not just the words---------------------------------------------------->
</body>
</html>Check out this Pen!
<script async src=”http://codepen.io/assets/embed/ei.js”></script>
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.