You are here:

DHTML/style="border:none" and style="{border:none}"

Advertisement


Question
Hi,

The following style is using the curly brace, is there different if I don't use the curly brace like style="{border:none}" ?
------------------
<td width="10%" style="border:none">welcome</td>
-------------------

Thanks,
lzzzz

Answer
I've never seen the curly notation for inline styling.  This is correct:

style="border:none"

However, you almost never want to use inline styling.  Better to use a class or a rule.  Say you want to remove the borders all <td>s inside of a table with an id of "table2".  You could write:

table#table2 td {
  border: none;
}

This is useful because you can touch that table's <td>s without touching any other <td>s on the page.  Also, the markup becomes simpler:

<td style="border:none">...</td>

becomes:

<td>...</td>


- Andrew

DHTML

All Answers


Answers by Expert:


Ask Experts

Volunteer


Andrew Hoffman

Expertise

Ask me about JavaScript, CSS, HTML5/XHTML, or PHP. Chances are I'll be able to help you. I know the economy is in the tank, but if you like my answer, please consider donating a few bucks. It's like tipping your barista, if your barista served fresh code instead of coffee.

Experience

I started doing this when boy bands were still cool.

Education/Credentials
I read a lot of nerdy books to get here.

©2012 About.com, a part of The New York Times Company. All rights reserved.