Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does breaking inline styling into multiple lines affect anything?

let's say I have a very long line of inline styling, for example:

<input type="radio" style="visibility: hidden; position: absolute; foo: bar; baz: foo; etcetera: etc; and: more;">

and then I decide to make it more readable like this:

<input type="radio" style="visibility: hidden; position: absolute;
    foo: bar; baz: foo; etcetera: etc; and: more;">

Does this affect the functionality or is it okay to break it into multiple lines like this?

like image 658
reifier Avatar asked Jul 12 '12 17:07

reifier


People also ask

Why is inline styling not recommended?

Inline styles, while they have a purpose, generally are not the best way to maintain your website. They go against every one of the best practices: Inline styles don't separate content from design: Inline styles are exactly the same as embedded font and other clunky design tags that modern developers rail against.

What is the disadvantage of the inline style technique?

Disadvantages of Inline CSS:Adding CSS rules to every HTML element is time-consuming and makes your HTML structure messy. Styling multiple elements can affect your page's size and download time.

Does inline style affect performance?

Ultimately, it's important in terms of inlining CSS and performance that you don't just dump all the CSS for your site into the head. If you inline too much, the performance implications will be worse than what you started with.

Why are inline styles bad for accessibility?

If styles are embedded directly into HTML elements using the style attribute the HTML can become hard to read (and thus maintain) and can present accessibility issues for some visitors to your website.


1 Answers

It's fine. White space doesn't affect the browsers interpretation of that CSS or rendering of that element.

like image 169
John Conde Avatar answered Sep 20 '22 05:09

John Conde