Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Stuck on CSS code..... HELP!

Featured Replies

Learning CSS and Im stuck! please help, below is the question I have been asked:

 

topic: Multiple Selectors

 

On the CSS tab, select only the h3 header nested inside three <div>s and change itscolor to red.

 

this is what my HTML looks like

 

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Result</title>
	</head>
	<body>
		<h3>I'm plain old font!</h3>
		<div>
			<h3>Me, too!</h3>
			<div>
				<h3>Me three!</h3>
				<div>
					<h3>Forget you guys. I'm about to be red!</h3>
				</div>
			</div>
		</div>
	</body>
</html>

 

In regards to the question I dont know how to write this in the CSS tab, please help!

  • Author

Create another div to match the h3 style with color red

Lol your'e on youngwebbuilder.com arent you

Either give it an ID like this...

 

<h3 id="h3header">Forget you guys. I'm about to be red!</h3>

 

And then select it in the CSS like this...

 

h3#h3header {
color: red;
}

 

OR it may be better to just select like this (this is the method that I think they are asking for although not necessarily the best in real practice as it can be confusing).

 

body div div div h3 {
color: red;
}

 

This way you won't have to change any of your HTML.

Edited by Alluziion

Agree with Alluziion ...

If you can give it a class... assign a CSS value. If you can't touch the HTML... then drill down with the CSS.

You MIGHT need to use "child and sibling" selectors though.

More info about these can be found here:
http://css-tricks.com/child-and-sibling-selectors/

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.