The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Formatting a hyperlink, Problems formatting the links to my other website pages
Forca
post Apr 29 2016, 03:39 PM
Post #1


Member
***

Group: Members
Posts: 33
Joined: 29-April 16
Member No.: 24,203



Hi

I am fairly new to all this. Have created a <div> tag to contain my links to the other webpages:

<div Id="Navigation">
<a href="index.html"> Home </a>
<a href="Training.html"> Training </a>
<a href="about.html"> About Us </a>
<a href="contact.html"> Contact Us </a>

</div>

The external CSS is as follows:

#Navigation {
width:500px;
height:60px;
clear:both;
border-style:solid;
border-width:1px;
}

a:link { /* default link properties */
font:Arial, Helvetica, sans-serif;
font-size:18px;
margin-top:30px;
padding-top:55px;
padding-left:15px;
padding-right:15px;
padding-bottom:0px;
clear:both;
color: #000;
}

Result is that the links are next to each other as desired but they are stuck in the top-left of the div. How do I get the links to move to the centre of the div?

Sorry, I do not know how to include the picture of what it looks like.

Thanks in advance.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 29 2016, 03:55 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



To center the links horizontally, text-align: center.
https://www.w3.org/TR/CSS2/text.html#propdef-text-align

To center it vertically I would remove the height from the DIV and give it some top and bottom padding instead.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Forca
post Apr 29 2016, 11:26 PM
Post #3


Member
***

Group: Members
Posts: 33
Joined: 29-April 16
Member No.: 24,203



Pandy, thanks. It worked beautifully.

Kind regards.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 30 2016, 09:16 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You're welcome. wink.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 09:17 AM