жирная линия под ссылкой, чтобы навести курсор мыши - PullRequest
0 голосов
/ 13 октября 2019

Я должен сделать так, чтобы, когда я наводил курсор мыши на надпись в навигационной панели внизу, должна была появиться толстая линия, как на этом фото:

enter image description here

на данный момент мне удалось все остальное, рабочая ссылка, которая ссылается на другую страницу, я просто пропускаю фиолетовую линию. Здесь я оставляю скриншот того, что мне удалось сделать и как это происходит:

enter image description here

здесь я также оставляю HTML-код того, что я сделал:

#font{
font-family: courier new;
font-size: 45px;
color: #8B0000
}

#nero{
width:2000px;
height: 600px;
background-color: black;
}

#bianco{
margin-left: 527px;
width:800px;
height: 300px;
background-color: #F5F5DC;
border-style:solid;
border-color:white;
border-width:5px;
font-family: Georgia;
color: DarkRed;
font-style: italic;
}

#img{
	margin-left:7px;
}

p{
	font-size:18px;
}

#bottone{
	margin-top:10px;
	font-family: Verdana;
}

#bottone1{
	margin-top:10px;
	margin-left:535px;
	font-family: Verdana;
}

#nero button{
background-color: black;
border: none;
color:white;
}

#tabella{
margin-left: 592px;
color:white;
text-align:center;
}

table td{
	padding: 0px 40px 0px 10px;
}

a:link, a:visited {
    text-decoration: none;
    color: white;
}
<html>
<head>
<link href="css.css" rel="stylesheet" type="text/css" media="all"/>
</head>
<body background="immagini/wood.jpg">
<br><br>
<b>
<font id="font">
<center>
Learn web development
</center>
</font>
</b>
<br><br>
<div id="bianco">
<br>
<img src="immagini/enjoy.png" align=left id="img">
<p align="justify">Al contrario di quanto si pensi, Lorem Ipsum non è semplicemente una sequenza casuale di caratteri. Risale ad un classico della letteratura latina del 45AC, cosa che lo rende vecchio di 200 anni. Richard McClintock, professore di latino al Hampden-Sydney Collage in Virginia, ha ricercato una delle più oscure parole latine, consectetur, da un passaggio del Lorem Ipsum e ha scoperto tra i vari testi in cui è citata, la fonte da cui è tratto il testo, le sezioni 1.10.32 and 1.10.33 del "de Finibus Bonorum et Malorum" di Cicerone. Questo testo è un trattato su teorie di etic, molto popolare nel Rinascimento. La prima riga di Lorem Ipsum, "Lorem ipsum dolor sit amet..", è tratta da un passaggio della sezione 1.10.32</p>
</div>
<div id="nero">

<button id="bottone1"><a>Home</a></button>&emsp&nbsp&nbsp
<button id="bottone"><a href="design.html">Design</a></button>&emsp&nbsp&nbsp
<button id="bottone"><a>Tools</a></button>&emsp&nbsp&nbsp
<button id="bottone"><a>How-to</a></button>&emsp&nbsp&nbsp
<button id="bottone"><a href="take.html">Take a tour</a></button>&emsp&nbsp&nbsp
<button id="bottone"><a>commercial</a></button>&emsp&nbsp&nbsp
<button id="bottone"><a>Contacts</a></button>
<br><br><br><br>
<table id="tabella">
	<tr>
	<center>
		<td><img src="immagini/direct.png" width="180px" height="85px"></td>
		<td><img src="immagini/social.png"  width="90px" height="85px"></td>
		<td><img src="immagini/lifetime.png"  width="110px" height="65px"></td>
	
	</tr>
	<tr>
		<td><b>Direct mentorship</b></td>
		<td><b>Social Learning</b></td>
		<td><b>Lifetime Access</b></td>
	</tr>
	<tr>
		<td>Experienced mentors will be with <br> you every step</td>
		<td>Learn in an intimate group of <br> passionate peers</td>
		<td>Become a part of the growing alumni <br> network</td>
		</center>
	</tr>
</table>

</div>
</body>
</html>

1 Ответ

1 голос
/ 13 октября 2019

Ответчик будет добавлять border-bottom при наведении курсора, что я сделал на #nero button:hover a, и чтобы он выглядел хорошо, я добавил к нему короткий transition, а также

#font{
font-family: courier new;
font-size: 45px;
color: #8B0000
}

#nero{
width:2000px;
height: 600px;
background-color: black;
}

#bianco{
margin-left: 527px;
width:800px;
height: 300px;
background-color: #F5F5DC;
border-style:solid;
border-color:white;
border-width:5px;
font-family: Georgia;
color: DarkRed;
font-style: italic;
}

#img{
	margin-left:7px;
}

p{
	font-size:18px;
}

.bottone{
	margin-top:10px;
	font-family: Verdana;
}

.bottone1{
	margin-top:10px;
	margin-left:535px;
	font-family: Verdana;
}

#nero button{
background-color: black;
border: none;
color:white;
}
#nero button:hover a{
  border-bottom: 3px solid purple;
  transition: 0.3s all ease;
}

#tabella{
margin-left: 592px;
color:white;
text-align:center;
}

table td{
	padding: 0px 40px 0px 10px;
}

a:link, a:visited {
    text-decoration: none;
    color: white;
}
<html>
<head>
<link href="css.css" rel="stylesheet" type="text/css" media="all"/>
</head>
<body background="immagini/wood.jpg">
<br><br>
<b>
<font id="font">
<center>
Learn web development
</center>
</font>
</b>
<br><br>
<div id="bianco">
<br>
<img src="immagini/enjoy.png" align=left id="img">
<p align="justify">Al contrario di quanto si pensi, Lorem Ipsum non è semplicemente una sequenza casuale di caratteri. Risale ad un classico della letteratura latina del 45AC, cosa che lo rende vecchio di 200 anni. Richard McClintock, professore di latino al Hampden-Sydney Collage in Virginia, ha ricercato una delle più oscure parole latine, consectetur, da un passaggio del Lorem Ipsum e ha scoperto tra i vari testi in cui è citata, la fonte da cui è tratto il testo, le sezioni 1.10.32 and 1.10.33 del "de Finibus Bonorum et Malorum" di Cicerone. Questo testo è un trattato su teorie di etic, molto popolare nel Rinascimento. La prima riga di Lorem Ipsum, "Lorem ipsum dolor sit amet..", è tratta da un passaggio della sezione 1.10.32</p>
</div>
<div id="nero">

<button class="bottone1"><a>Home</a></button>&emsp&nbsp&nbsp
<button class="bottone"><a href="design.html">Design</a></button>&emsp&nbsp&nbsp
<button class="bottone"><a>Tools</a></button>&emsp&nbsp&nbsp
<button class="bottone"><a>How-to</a></button>&emsp&nbsp&nbsp
<button class="bottone"><a href="take.html">Take a tour</a></button>&emsp&nbsp&nbsp
<button class="bottone"><a>commercial</a></button>&emsp&nbsp&nbsp
<button class="bottone"><a>Contacts</a></button>
<br><br><br><br>
<table id="tabella">
	<tr>
	<center>
		<td><img src="immagini/direct.png" width="180px" height="85px"></td>
		<td><img src="immagini/social.png"  width="90px" height="85px"></td>
		<td><img src="immagini/lifetime.png"  width="110px" height="65px"></td>
	
	</tr>
	<tr>
		<td><b>Direct mentorship</b></td>
		<td><b>Social Learning</b></td>
		<td><b>Lifetime Access</b></td>
	</tr>
	<tr>
		<td>Experienced mentors will be with <br> you every step</td>
		<td>Learn in an intimate group of <br> passionate peers</td>
		<td>Become a part of the growing alumni <br> network</td>
		</center>
	</tr>
</table>

</div>
</body>
</html>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...