Skip to main content
Participant
Jan 10, 2023 12:54 PM UTC
Question

I keep getting this error: The value of attribute [ style ] must be in double quotes.

Hello,

 

I am using this bottstrap template and i keep getting this error no matter how i modify my code.

if i use double quotes, my image wont show as a background.

 

the website is live on: www.elissaco.com

 

and here is a text copy of the code:

<div class="col-lg-5 align-items-stretch order-1 order-lg-2 img" style='background-image: url("assets/img/120s.png");' data-aos="zoom-in" data-aos-delay="150">
</div

 

along with a screenshot of what adobe shows me

    This topic is closed to new replies. Start a new post to keep the conversation going.

    4 replies

    Nancy OShea
    Community Expert
    Community Expert
    Jan 10, 2023 8:10 PM UTC

    This works.

    style="background-image: url('assets/img/120s.png');"

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    majd0D4CAuthor
    Participant
    Jan 10, 2023 11:53 PM UTC

    Thank you! it worked ))

    Translate
    Jon Fritz
    Community Expert
    Community Expert
    Jan 10, 2023 1:40 PM UTC

    Yeah, this is part of DW's Linter settings and can be turned off, since alternating nested quote styles is correct. The Linter is just a bit overzealous and tries to force the will of whoever designed it onto your code. 

    1. Open DW and go to Edit > Preferences > Linting

    2. Click HTML so it's highlighted

    3. Click Edit & Apply Changes

    4. In the file that comes up, near the top, change the line... 

    "attr-value-double-quotes": true,

    ...to...

    "attr-value-double-quotes": false,

    4. Save and close. The warning should be gone.

    Translate
    Legend
    Jan 10, 2023 1:01 PM UTC

    Try using double quotes around the style tag but single quotes around the background image url path/name. 

     

    It doesn't matter if the style tag has single quotes around it. I think Dreamweaver is just using its own preference rather than it being an exacting requirement.

    Translate