Jump to content

Links side by side


jtikcuf

Recommended Posts

i tried this earlier <p><strong><a href="index.html" class="auto-style1">Appetizers | Nachos | Soups | Seafood | Steak </a></strong></p><p><strong><a href="index.html" class="auto-style1">Appetizers | Lunch | Desserts | Kids | Texmex | Tacos </a></strong></p><p> i liked this look http://www.youtube.com/watch?v=AY81u4YOJuk&feature=youtu.be

Link to comment
Share on other sites

The <p> tag is what is preventing the links from appearing next to eachother. <p> elements are blocks and therefore force adjacent elements to go above and below them. The <strong> tag should be omitted because you can use CSS on the link itself to make the text bold.

Link to comment
Share on other sites

Just remove the <p> and <strong> tags. Use CSS to add style properties to the link.
... I totally skipped the <P> tags some how, so my suggestion won't work :PYou could omit the <p> tags for say, a <ul> and <li> set of tags and display them horizontally with CSS, OR you could float the <p> tags left with a common class, or inline-styling if you have too...EDIT: I've been yelled at by a lot of people saying "<a> link anchors are not containers! Don't use them as such... blah blah blah" when I don't contain an anchor within a <p> or <div> or something... That is why I am suggesting a <ul> <li> set. Edited by Krewe
Link to comment
Share on other sites

in the interest of advancing best practices, using a table was definitely a backwards step as far as solutions go for solving this problem

  • Like 2
Link to comment
Share on other sites

The answer was much simpler than using a table, this works:

<a href="index.html" class="auto-style1">Appetizers | Nachos | Soups | Seafood | Steak </a><a href="index.html" class="auto-style1">Appetizers | Lunch | Desserts | Kids | Texmex | Tacos </a>

Much less mark-up and semantically correct.And some CSS which takes care of the purpose the <strong> tags had:[code[.auto-style1 { font-weight: bold; }[/code]

Link to comment
Share on other sites

The answer was much simpler than using a table, this works:
<a href="index.html" class="auto-style1">Appetizers | Nachos | Soups | Seafood | Steak </a><a href="index.html" class="auto-style1">Appetizers | Lunch | Desserts | Kids | Texmex | Tacos </a>

Much less mark-up and semantically correct.And some CSS which takes care of the purpose the <strong> tags had:

.auto-style1 { font-weight: bold; }

This works, but not for what he needs. He wants each word as a link.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Link Test</title><style type="text/css">p{  margin: 0 0 10px 0;  padding: 0;}a.menuLinks{  font-weight: bold;  margin: 5px;}</style></head><body><p><a href="#appetizers" class="menuLinks">Appetizers</a> | <a href="#nachos" class="menuLinks">Nachos</a> | <a href="#soups" class="menuLinks">Soups</a> | <a href="#seafood" class="menuLinks">Seafood</a> | <a href="#steak" class="menuLinks">Steak</a></p><p><a href="#lunch" class="menuLinks">Lunch</a> | <a href="#desserts" class="menuLinks">Desserts</a> | <a href="#kids" class="menuLinks">Kids</a> | <a href="#texmex" class="menuLinks">Texmex</a> | <a href="#tacos" class="menuLinks">Tacos</a></p></body></html>

I did the href's as "#link" because I am assuming he wants them to jump to a name anchor link.

  • Like 1
Link to comment
Share on other sites

This works, but not for what he needs. He wants each word as a link.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Link Test</title><style type="text/css">p{  margin: 0 0 10px 0;  padding: 0;}a.menuLinks{  font-weight: bold;  margin: 5px;}</style></head><body><p><a href="#appetizers" class="menuLinks">Appetizers</a> | <a href="#nachos" class="menuLinks">Nachos</a> | <a href="#soups" class="menuLinks">Soups</a> | <a href="#seafood" class="menuLinks">Seafood</a> | <a href="#steak" class="menuLinks">Steak</a></p><p><a href="#lunch" class="menuLinks">Lunch</a> | <a href="#desserts" class="menuLinks">Desserts</a> | <a href="#kids" class="menuLinks">Kids</a> | <a href="#texmex" class="menuLinks">Texmex</a> | <a href="#tacos" class="menuLinks">Tacos</a></p></body></html>

I did the href's as "#link" because I am assuming he wants them to jump to a name anchor link.

WoW i used this, you are super kool Omg there's lots i don't know........ :-(Thanks :Pleased: :Pleased: :Pleased: Edited by jtikcuf
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...