Skip to content

Commit 0209a0f

Browse files
authored
Inline Style rules and Cross-browser
1 parent 366e652 commit 0209a0f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
- [ID Selectors](#id-selectors)
1717
- [JavaScript hooks](#javascript-hooks)
1818
- [Border](#border)
19+
- [Inline Styles](#inline-styles)
20+
- [Cross-Browser compatibility](#cross-browser-compatibility)
1921
1. [License](#license)
2022

2123
## Terminology
@@ -226,6 +228,43 @@ Use `0` instead of `none` to specify that a style has no border.
226228
```
227229
**[⬆ back to top](#table-of-contents)**
228230

231+
## Inline Styles
232+
Avoid at all cost using inline styling as it will stay out from the stylesheet standard and overwriting initial styles.
233+
Styles become harder to maintain and document.
234+
235+
**Bad**
236+
237+
```html
238+
<div style="color:#f00;float:left;">
239+
Lorem Ipsum
240+
</div>
241+
<div style="color:#000;">
242+
Foo Bar
243+
</div>
244+
<div style="color:#f00;">
245+
Dolores Amit
246+
</div>
247+
```
248+
249+
**Good**
250+
251+
```css
252+
.foo{
253+
color: #f00;
254+
}
255+
```
256+
257+
## Cross-Browser compatibility
258+
Ensure your styles work well on all browsers such as IE, Opera, Chrome, etc..
259+
260+
```css
261+
.foo{
262+
-moz-
263+
-webkit-
264+
-o-
265+
-ms-
266+
}
267+
```
229268

230269
## License
231270

0 commit comments

Comments
 (0)