aligning and positioning multiple...

User 107145 Photo


Registered User
88 posts

I am trying to left justify these links and then move the list towards the center of the document. When I put in 'left', 'right' or 'justify' in the text-align CSS, it doesn't change anything. I have tried the 'position' CSS but that did not work. Below is the code I used.

Thanks for your help
pk


CSS code....
a.jump:link, a.jump:visited {
text-decoration:none; color:#5c3e90; font-size:14px;
font-family:"garamond";
}

a.jump:hover {
color:#FF8000;
}

#jumpjust {
text-align:justify; position:relative; left:100px;
}



html code.....

<div class="jumpjust">
<a class="jump" href="#shipp"> Shipping </a><br />
<a class="jump" href="#return"> Return </a><br />
<a class="jump" href="#phone"> phone </a><br />
<a class="jump" href="#mail"> Mail </a><br />
<a class="jump" href="#stock"> stock </a><br />
<a class="jump" href="#tax"> Tax </a><br />
<a class="jump" href="#privacy"> Privacy </a><br />
</div>
... so much to learn!!
User 355448 Photo


Ambassador
3,144 posts

pk,

I would like to see this in the wild so to speak, so if possible post a link.

#jumpjust sets an if of jumpjust, so use <div id="jumpjust'>

Then try setting your style like this:

#jumpjust {
text-align:justify;
margin-left:100px;
}

That may be what you want. Try it and let us know how it works.
User 463058 Photo


Ambassador
1,086 posts

Since your links are a list, you should use a list:

<ul id="jumpjust">
<li><a href="#shipp">Shipping</a></li>
<li><a href="#return">Return</a></li>
<li><a href="#phone">Phone</a></li>
<li><a href="#mail">Mail</a></li>
<li><a href="#stock">Stock</a></li>
<li><a href="#tax">Tax</a></li>
<li><a href="#privacy">Privacy</a></li>
</ul>


Then your styling would look something like this:

#jumpjust {
margin:0 0 0 100px; /* left margin of 100px */
padding:0;
list-style:none;
}
#jumpjust li {
padding:0;
margin:0;
}
#jumpjust a {
text-decoration:none;
font-size:14px;
font-family:Garamond, "Times New Roman", Times, serif;
}
#jumpjust a:link, #jumpjust a:visited {
color:#5c3e90;
}
#jumpjust a:hover {
color:#FF8000;
text-decoration: underline;
}


If you want the list centered, you could change the first style rule like this:

#jumpjust {
margin:0 auto; /* auto side margins for centering */
padding:0;
list-style:none;
width:5em; /* centering won't work without a width. 5em may be too big. */
}
User 107145 Photo


Registered User
88 posts

BillR got it right by changing "class'' to "id" it works.... but thanks to all for the help

Thanks
pk
... so much to learn!!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.