Jump to content
  • 0

Проблема с first-child


pavlovda
 Share

Question

Здравствуйте участники форума вот такой вопрос:

объясните почему не срабатывает псевдокласс first-child исходные коды прилагаю ниже

<!DOCTYPE html><html>	<head>		<meta charset = "utf-8" />		<link rel="stylesheet" href="style.css" type="text/css" />		<title>sample listing</title>	</head><body><div class = "karkas">	<img src = "img/post-img.jpg" alt = "" />	<p>	Ut wisi enim ad minim veniam, quis nostrud exerci tation	</p>		<p>	Duis autem vel eum iriure dolor in hendrerit in vulputate velit diam voluptua. At vero eos et accusam esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto.	</p>	<p>	Odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.	</p></div></body></html>
* {margin: 0 ;padding: 0 ;}ul{list-style-type: none ; }img {border: none ;}.karkas p {font-family: Areal ;font-size: 20px ;color: skyblue ;}.karkas p:first-child{color: orange ;}

При этом если убрать из примера картину, то все отрабатывает нормально как положено.

Объясните в чем проблема.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy