Adjust css examples formatting (#26127)

This commit is contained in:
David Way
2018-12-13 05:03:03 +00:00
committed by Tom
parent 18d5502965
commit 012e93154b
35 changed files with 303 additions and 326 deletions

View File

@ -10,9 +10,9 @@ Let's look at some examples:
<!--Css -->
```css
p::before {
content: "";
border: solid 5px #ccc
p::before {
content: "";
border: solid 5px #ccc;
}
span.comment::before{
@ -34,7 +34,7 @@ span.comment::before{
```
In the example above we are prepending a grey border before every paragraph element on a page and we are also prepending the words comment in blue before every span element with the class comment.
In the example above we are prepending a grey border before every paragraph element on a page and we are also prepending the words comment in blue before every span element with the class comment.
> You can check out this demo here https://jsfiddle.net/398by400/
@ -42,9 +42,9 @@ In the example above we are prepending a grey border before every paragraph elem
`::before` is one of the CSS pseudo-elements selectors, which are used to style specified parts of an element. In this case, we can insert content before some HTML element from CSS. Although we will see the content in the page, it is not part of the DOM, what means that we can't manipulate it from Javascript. One trick to solve this handicap: passing the content with a data attribute and use jQuery to manipulate it. Here is an example of use:
```css
p::before {
content: "Hello ";
}
p::before {
content: "Hello ";
}
```
```html