Please help with CSS, I am newbie

Html isn’t about ‘results’ or presentation its about structure.

In the first example it is clear from the mark up that the word school was deleted and the word college inserted.

In the second example the only certain thing is that the word school was deleted but we do not know with what it has been replaced (although we can obviously guess but that’s not the point). It’s usually used when published text has later been changed to show that the text and therefore the meaning may have changed also.

When you add the correct semantics to a document it allows tools/screen readers/ authors to extract more pertinent data from them.

3 Likes

I suppose you could use that markup to allow a user to display a pre-edit version, if you applied css to hide the <ins> and show the <del>, that way you would not need to have the two separate versions.

Hello, could you explain pseudo elements, I checked on w3schools but i still dont understand .Why we should use them instead of common elements. Purpose?

We do not use them instead of common elements.
We use them in addition to common elements.

They provide additional styling capabilities without requiring additional HTML.

I cant figure out why we need style links with pseudo elements. How it would look like without them?

Does this article help to explain pseudo-elements for you?

1 Like

Show the HTML and related CSS code that is puzzling you.

Open a page in your favorite browser that uses pseudo-elements in the CSS.

Read the code so you can try to understand what the styles say they should do.

Comment out the pseudo-elements in the CSS.

Open the page in another tab (or window) in your browser.

Compare the page in the first tab with the page in the second tab and see what is different.

Pseudo elements is just a way to define different styles for different link states.
Each link can have many states: regular, hovered, clicked (active), focused.

This is how you make your link green in regular state (when it’s just displayed):

a { 
    color: green; 
}

But what if you do want that link to become red when user puts mouse cursor over it?
Here is where pseudo-element comes to help:

a:hover {  /* this rule applies when <a> is hovered by mouse */
    color: red;
}

After reading @megazoid’s post, I wonder if you are referring to pseudo-classes as pseudo-elements. You do mention a link.

Please read this and see if it helps…

http://www.growingwiththeweb.com/2012/08/pseudo-classes-vs-pseudo-elements.html

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.