Formatting a hyperlink, Problems formatting the links to my other website pages |
Formatting a hyperlink, Problems formatting the links to my other website pages |
Forca |
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. |
pandy |
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. |
Forca |
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. |
pandy |
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.
|
Lo-Fi Version | Time is now: 23rd April 2024 - 09:17 AM |