Why doesn't this change the hover link state?

a.hover { background-color:blue;
color:red;
font-weight:bold;
font-decoration:underline;

}

(greater than sign) p>Click (greater than sign) a href=“http://google.com”> this to link to google

The pseudo class is badly written, you must change the point by two points.

a:hover { background-color:blue;
color:red;
font-weight:bold;
font-decoration:underline;
}

Your code didn’t fix it.
How is it badly written? a: hover { }

Also why isn’t this adding a border to my table?

table {
border: 3px solid black;
}

(<)table>
(<)tr>Player
(<)th>Lebron James
(<)th>Los Angeles Lakers


(<)th>Kobe Bryant
(<)/tr>
(<)tr>Team
(<)td>Kobe Bryant
(<)td>Los Angeles Lakers/Retired
(<)td>Klay Thompson
(<)/tr>
(<)/table>

You have it this way:

a.hover {}

And the correct thing is:

a:hover {}

It still didnt fix it. I changed a.hover to a:hover

Do you know why my table isn’t bordered?

This code works for me

<p>Click (greater than sign) <a href=“http://google.com”> this to link to google</a></p>
a:hover { 
  background-color:blue;
  color:red;
  font-weight:bold;
  font-decoration:underline;
}

This also works for me

<table>
  <tr>Player
    <th>Lebron James
    <th>Los Angeles Lakers
    <th>Kobe Bryant
  </tr>
  <tr>Team
    <td>Kobe Bryant
    <td>Los Angeles Lakers/Retired
    <td>Klay Thompson
  </tr>
</table>
table {
	border: 3px solid black;
}

If it does not work, you should verify how you are importing the CSS file into your HTML or if the way you are placing the styles is correct.

I knew it was correct.

Why doesn’t this change the text color in a ? I think its correct.

span {
background-color: blue;
color: red;
font-weight: bold;
}

(<) h2>Welcome to my (<)span>stats website.

remove the parenthesis obviously

This isn’t creating a border around my image.

.centerimglbj {
border: 6px solid black;
}

*<)a href=“http://lebronjames.com”>(<i)mg src=“lbj.jpg” class="centerimagelbj"title=“Lebron James Is The Greatest Player” height=“350” width=“1650”></a(>)

I am using notepad++, saving as index.html and opening with a browser.

This works for me

<h2>Welcome to my <span>stats website.</span></h2>
span {
  background-color: blue;
  color: red;
  font-weight: bold;
}

For the edge of the image
Look at the name of the class, you call it different, it would be like that.

<a href="http://lebronjames.com"><img src="lbj.jpg" class="centerimagelbj" title="Lebron James Is The Greatest Player" height="350” width="1650”></a>
.centerimagelbj { 
	border: 6px solid black; 
}

Why doesnt this pseudo element apply to my first letter?

p:first-letter {
font-weight: bold;
font-size: 23px;
color:white;
}

Why does this not change my header to different color, not center it, same for link?

(<)!DOCTYPE html>
(<)html>
(<)head>
(<)title>Stats

(<)style=“text/css”>
h1 {
text-align: center;
font-weight:bold;
background-color: white
color: red;
border: 4px solid white;
}

a {
text-align: center;
font-size: 20px;
font-weight: bold;
color: red;
}
(<)/style>
(<)/head>

(<)body background=“secondpagebg.jpg”>
(<)h1>Offical Stats Page

(<)a href=“index.html”>Go To Main Page

(<)/body>

(<)/html>

What do you mean?

Also,

Why doesn’t this code make my link go to the center of the page? I tried two methods.

I created a class.

.officalstats {
text-align:center;
}

and i used the a element(it’s called an element right?)

a {
text-align:center;
}

?

Please wrap your code snippets with triple backticks

```
//code goes here
```

//code goes here
2 Likes

When an answer helps you solve something give at least one I like, it does not take much time and so we realize if the contribution has been valuable or not.
On the other hand I think you are asking too much and are questions that are not related to the problem you initially published, for a better order you should create a new question and not mix them all, but before posting so many questions I invite you to analyze very well the problems that are presented and try to find a solution either by consulting or watching tutorials, I assure you that learning is too much for you, publish a problem should consider it as the last option having exhausted all options and possible ways to find a solution .

2 Likes

Use a code wrapper like camelcamper mentioned.

Second thing, your code doesn’t work because your CSS or HTML is messed up.
Put your code on codepen, jsfiddle or the like, it’ll be way easier to debug.

You are a troll. I don’t care about your opinion.

It does not matter if you do not want to progress!

Take it easy-- he is not a troll. He is trying to help you.

You remind me a bit of the old online riddles days when I used to do them. The riddle levels were meant to take however long it takes… some easy some super hard that it took days, weeks… even months to solve. Then there were the riddlers who the second couldn’t solve it in less than hour or two ran to the forums to ask either “I can’t solve x, what do I do?” or “give me the answer!”- the ones who gave it at leas a day of trying got more and better hints.

I’m glad you are asking questions. I don’t know how long you are spending on researching or figuring out what the problem is before coming to the forum to ask why something is not working.

(FWIW-- since everything is CSS related I’m wondering if it’s how you are calling your css file)

Oh… No I’m not a troll either. Just a friendly duck.

1 Like