[Solved] I am really new to HTML and was wondering how you center multiple links with html and add color the link at the same time?


Yes; you should go to the links Howzieky provided. When in doubt, w3schools is right. Codeacademy is great, but teaches some bad practices.

However, that doesn’t help you right now. So, I’ll try to nudge you along.

First: look up how to link an external style sheet. Keeping your code clean is good when you’re just learning.

Now, assuming you have a list of links that will be displayed as a list, you need to remember that code semantics is important for accessibility and seo. So, if it’s a list of any kind, it goes inside a list element.

So, start with:

<ol>
<li><a href="">link  text</a></li>
<li><a href="">link  text</a></li>
</ol>

ol is better accessibility than ul, but both work.

Now, first style your list so you get rid (visually) of the bullits/numbers, and have a block that will play nice:

ol {
display: block; 
width: 100%; 
height: auto;
overflow: hidden;
/* This sets you up with a block that will scale down nicely if your text is too long. */

margin: 0; 
padding: 0;
/* Because it's a headache to find where whitespace is coming from later, I always advise to null the padding and margin and use a container if you need gutters later. This also nixes the space reserved for the bullits/numbers. */

list-style-type: none;
/* Get rid of the bullits/numbers for realsies */
}

Now, to style the list items:

ol li {
display: block;
width: 100%;
height: auto;
padding: 0;
margin: 0;
list-style-type: none; /* For IE 9 and lower. */
text-align: center; /* Here's your centered links */
}

Just one more step:

ol li a,
ol li a:link {
color: red;
}

ol li a:hover,
ol li a:focus,
ol li a:active {
/* do something here to change the links visually when hovered/clicked/tabbed to, be nice to your users. */
}

HTH. Have fun & good luck.

0

solved I am really new to HTML and was wondering how you center multiple links with html and add color the link at the same time?