Technical Documentation Page - Build a Technical Documentation Page

Tell us what’s happening: the media query is not passing the test i have tried many methods but nothing seems to work.

Your code so far
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}

#navbar {
background-color: #333;
color: #fff;
padding: 10px;
}

#navbar header {
margin-bottom: 0;
}

#navbar hr {
border-color: #fff;
margin: 5px 0;
}

#navbar .nav-link {
color: #fff;
text-decoration: none;
display: block;
margin: 10px 0;
}

.main-section {
padding: 20px;
}

.section-header {
font-size: 1.2rem;
margin-bottom: 10px;
}

.section-content {
margin-bottom: 15px;
}

.codeCase {
background-color: #f1f1f1;
padding: 10px;
margin-bottom: 15px;
}

.codeCase code {
display: block;
}

#footer {
background-color: #333;
color: #fff;
padding: 10px;
text-align: center;
font-size: 0.8rem;
}

#footer span {
display: block;
margin-top: 5px;
}

#navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
}

#navbar header {
margin-bottom: 0;
}

#navbar .nav-link {
margin: 0;
}

#main-doc {
display: flex;
flex-wrap: wrap;
}

.main-section {
flex-basis: 50%;
}

/* Media query for screens with a maximum width of 768px */
@media (max-width: 768px) {
#navbar header {
font-size: 1.5rem;
margin-bottom: 10px;
}

.main-section {
flex-basis: 100%;
}
}

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.
@media (max-width: 768px) {

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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

Challenge: Technical Documentation Page - Build a Technical Documentation Page

Link to the challenge:

We really need to see your HTML as well. And you need to paste both your CSS and HTML in here using the following method.

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

But I will take a guess. Did you remember to do the following?

Note: Be sure to add <link rel="stylesheet" href="styles.css"> in your HTML to link your stylesheet and apply your CSS”

I am not really sure if this could be a problem that is causing you the trouble, but in your css before media query you have twice the same css rule for your navbar header.
And also two separate rules for class main-section, try to put them together

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.