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.

Whats wrong with this simple code?

Featured Replies

So Im elarning to code and I swear code academy is faulty what have I done wrong?

 

Question:

  • On line 7, make the text size 8px.
     
  • On line 8, make the text size 12px.
     
  • On line 9, make the text size 44px.


<!DOCTYPE html>
<html>
<head>
<title>First font size change</title>
</head>
<body>
<p> <p style = "font-size: 8px">Some text for you to make tiny! </p>
<p> <p style = "font-size: 12px">Some text for you to make normal size!</p>
<p> <p style = "font-size: 44px"> Some text for you to make super big!</p>
</body>
</html>

Edited by Juelz

Well you've opened a <p> tag...

<p style = "font-size: 8px">

 

Then opened another one directly after (without any styling)...

<p>Some text for you to make tiny!

 

And then you only closed one and you also close an <a> tag that never started...

</p></a>

 

Also, on the second line of content, you have a rogue "> just before you opened the second <p> tag.

 

Just to help you a little further... I'm not sure exactly what it is that you're trying to accomplish but I'm assuming that it's supposed to look like this...

<!DOCTYPE html>
<html>
<head>
 <title>First font size change</title>
</head>
<body>
 <p style="font-size: 8px">Some text for you to make tiny!</p>
 <p style="font-size: 12px">Some text for you to make normal size!</p>
 <p style="font-size: 44px">Some text for you to make super big!</p>
</body>
</html>

  • Author

Well you've opened a <p> tag...

<p style = "font-size: 8px">

 

Then opened another one directly after (without any styling)...

<p>Some text for you to make tiny!

 

And then you only closed one and you also close an <a> tag that never started...

</p></a>

 

Also, on the second line of content, you have a rogue "> just before you opened the second <p> tag.

 

Just to help you a little further... I'm not sure exactly what it is that you're trying to accomplish but I'm assuming that it's supposed to look like this...

<!DOCTYPE html>
<html>
<head>
<title>First font size change</title>
</head>
<body>
<p style="font-size: 8px">Some text for you to make tiny!</p>
<p style="font-size: 12px">Some text for you to make normal size!</p>
<p style="font-size: 44px">Some text for you to make super big!</p>
</body>
</html>

Its a html tutorial from code academy and I didnt actually write the code... I only added in the "<p style="font-size: 8px">" which was from there example!

 

 

Heres another example they give

 

To change the color of text, simply add the style attribute in the opening tag, then make the style equal to "color:blue" (or whatever color you like). For example:

<h2 style="color:red">

Edited by Juelz

You added a new <p> element rather than editing their existing one...

 

Rather than adding...

<p style="font-size: 44px">

 

You should have just added...

style="font-size: 44px"

to the existing <p> element like I've demonstrated in my example.

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.