Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Jan 10, 2023 Jan 10, 2023

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

codeerror.png

1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 10, 2023 Jan 10, 2023

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 10, 2023 Jan 10, 2023

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 10, 2023 Jan 10, 2023

This works.

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

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 10, 2023 Jan 10, 2023
LATEST

Thank you! it worked ))

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines