Learn Accessibility by Building a Quiz - Step 48

can someone tell me what it means by You should add a main selector to target the main element.

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: Learn Accessibility by Building a Quiz - Step 48

Link to the challenge:

Unfortunately, we can’t see your code

a selector is a word that tells the browser that you want it to select a specific element in the html and do something interesting with it.
Say I had this code:

<p>This is a boring paragraph</p>

and I wanted to tell the browser, via some css code, that I want this paragraph to be red, I would do it like this

p {
  color: red;
}

and I would put that information in a stylesheet (or within the style element block)

body {
background: #f5f6f7;
color: #1b1b32;
font-family: Helvetica;
margin: 0;
}

header {
width: 100%;
height: 50px;
background-color: #1b1b32;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
top: 0;
}

#logo {
width: max(100px, 18vw);
background-color: #0a0a23;
aspect-ratio: 35 / 4;
padding: 0.4rem;
}

h1 {
apply-text-align: center;
color: #f1be32;
font-size: min(5vw, 1.2em);

}

nav {
width: 50%;
max-width: 300px;
height: 50px;
}

nav > ul {
display: flex;
justify-content: space-evenly;
}

nav > ul > li {
color: #dfdfe2;
margin: 0 0.2rem;
padding: 0.2rem;
display: block;
}

nav > ul > li:hover {
background-color: #dfdfe2;
color: #1b1b32;
cursor: pointer;
}

li > a {
color: inherit;
text-decoration: none;
}

h1,
h2 {
font-family: Verdana, Tahoma;
}

h2 {
border-bottom: 4px solid #dfdfe2;
}

p::before {
content: “Question #”;
}

.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}

yeah thank you, i do know that. The thing I got confused about was
When the screen width is small, the h1 does not wrap its text content how it should. Align the text for the h1 element in the center.

Then, give the main padding such that the Student Info section header can be fully seen.

it has been confusing me because I did try following the instructions but it wouldn’t do anything

the correct style for aligning should be text-align

After fixing that, you will need a new main selector (you don’t have one defined yet)
And you will need to set the padding to a value that makes the words show (just take a guess and then the hints will help you along if you get it wrong)

1 Like

Thank you very much this helped me

1 Like