+ 1

Why the style is not applied to an individual element of the class? CSS

why the style is not applied to an individual element of the class, but everything is in order with the rest. Checked no thoughts.

6th Jan 2020, 7:17 PM
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½ - avatar
11 Answers
+ 3
Can we see your code?
6th Jan 2020, 7:55 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Becouse your link to css style file was written twice (css.css and style.css). Where is situaded this file?
6th Jan 2020, 8:14 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
to avoid confusion, use while learning or only external styles (in the file), or only internal (setting them in the opening tag of each element)
6th Jan 2020, 8:18 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Use for one element style id http://htmlbook.ru/html/attr/id
6th Jan 2020, 8:30 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Good, then delete this line: <link rel="stylesheet" href="css/style.css">
6th Jan 2020, 8:47 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
And if your css.css is situated near html file (not in included folder css), write: <link rel="stylesheet" href="css.css">
6th Jan 2020, 9:19 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Yeah, you can: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="css/css.css" rel="stylesheet"> <link rel="stylesheet" href="css/style.css"> <title>Π–ΠΈΡ‚ΡŒ щасливо</title> </head> <body> <div class="overlay"> <nav class="overlayMenu"> <ul role="menu"> <li><a href="index.html" role="menuitem">Main</a></li> <li><a href="LiveHappy.html" role="menuitem">Live happy</a></li> <li><a href="#" role="menuitem">#</a></li> <li><a href="#" role="menuitem">#</a></li> <li><a href="#" role="menuitem">#</a></li> </ul> </nav> </div> <div class="navBurger" role="navigation" id="navToggle"></div> <div id="indent"> <h1>Как ΠΏΡ€ΠΎΠΆΠΈΡ‚ΡŒ Тизнь щасливо?</h1> <h2>ΠŸΡ€ΠΈΠ½ΠΈΠΌΠ°ΠΉ настоящСС</h2> <ul class="text"> <li>Π–ΠΈΡ‚ΡŒ сСйчас. ΠΠ°ΡΠ»Π°ΠΆΠ΄Π°Ρ‚ΡŒΡΡ Π΄Π°Ρ€ΠΎΠΌ настояСщСго </li> <li>Никогда Π½Π΅ приносит ΡΡ‡Π°ΡΡ‚ΡŒΠ΅ Π² ΠΆΠ΅Ρ€Ρ‚Π²Ρƒ достиТСниям </li> <li>ΠΠ°ΡΠ»Π°ΠΆΠ΄Π°Ρ‚ΡŒΡΡ Π΄ΠΎΡ€ΠΎΠ³ΠΎΠΉ ΠΈ ΠΏΡ€ΠΎΠΆΠΈΠ²Π°Ρ‚ΡŒ ΠΊΠ°ΠΆΠ΄Ρ‹ΠΉ дСнь ΠΊ
6th Jan 2020, 8:08 PM
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½ - avatar
0
body{ background-color: #C9FFBF; margin: 50; padding: 25; } A { text-decoration: none; } .mainHead{ font-size: 60px; text-align: center; background-color: red; display: inline-block; margin-left: 25%; margin-right: 25%; } .h2rules{ text-align: center; font-size: 35px; } .text{ font-size: 25px; } footer{ text-align: center; background-color: silver; } h1{ text-align: center; font-size: 45px; } #indent{ margin-left: 15%; margin-right: 15%; }
6th Jan 2020, 8:08 PM
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½ - avatar
0
just look that in the class the text does not change the size of the text in all elements
6th Jan 2020, 8:10 PM
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½ - avatar
0
so the problem is that the font size is applied to all elements of the "text" class, but not to 1 of them.
6th Jan 2020, 8:23 PM
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½ - avatar
0
It’s located in the same folder as CSS.css, but I just didn’t drop it to you, since it is intended for the menu.
6th Jan 2020, 8:27 PM
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½
Π‘ΠΎΡ‚Π½ΠΈΠΊ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½ - avatar