Jump to content

Double quotes for attributes


Poojana

Recommended Posts

Hi,

I recently started using html on a Mac. I noticed that using the double quotes for an attribute gives an error, as seen in the images attached. I faced the same problem while using the title attribute for the paragraph tag. The first double quote and the first world only were displayed as a tooltip.

Thank you.

Screen Shot 2019-06-07 at 11.56.04 AM.png

Link to comment
Share on other sites

That would be because attributes aren't supposed to be surrounded in quotes. Only their values.

Also, the bgcolor attribute on your body is old, and should be replaced with background-color in your styling/css.

Try this on for size

<!DOCTYPE html>
<html>
  <head>
    <title>HTML page</title>
  </head>
  <body style="color: pink; background-color: black">
    <h1>Testing</h1>
    <h5>Heading 5</h5>
    <p title="Dummy text">
      Lorem Ipsum Dolor Sit Amet.
    </p>
  </body>
</html>

May I suggest looking into a code editor? I personally use Visual Studio Code

 

  • Thanks 1
Link to comment
Share on other sites

There's also the problem that your code is using curly quotes instead of regular ones. You might need a different code editor.

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...