Clase si Id-uri

postat acum 6 ani de Stefanescu Mihai in categorie CSS

Pentru a te ajuta sa modifici un anumit element din pagina HTML, in CSS pot fi definite clase si id-uri.

Selectorul ID

Acest tip de selector este menit sa tinteasca un singur element si doar atat. Acest id poate fi atribuit unui elment din pagina HTML cu regula id=”#nume”:

#nume{
    text-align: center;
    color: red;
}

Selectorul Clasa

Acest selector este folosit pentru a modifica un grup de elemente, spre deosebire de Id ce nu putea fi folosit decat pentru un element.

Cu acest selector poti seta stiluri diferite pentru elemente diferite cu aceeasi clasa. Acest selector se seteaza cu “.” inaintea numelui in CSS, iar in HTML cu sintaxa class=”numeleclasei”:

.numeleclasei{
    text-align: center;
    color: red;
}

Poti specifica ce element va avea o anumita proprietate cand are setata aceasta clasa. In exemplul de mai jos toate paragrafele (<p>) din interiorul elementului ce contine clasa numeleclasei vor avea fi alianiate in centru:

.numeleclasei p{
    text-align: center;
}

 

Sunt un tanar programator din Bucuresti ce lucreaza in PHP/Mysql (MySqli/PDO), Laravel, CodeIgniter, MySQL, PostgreSQL, Wordpress, HTML5/CSS3, Sass, Photoshop si multe altele.
Google+ Community Facebook Group
Acest articol a fost mutat de pe vechea platforma.
Pentru orice eroare aparuta la mutare va rog sa ma contactati!

Comentariu postate de minecraft download free la data de 15.05.2019
My spouse and I stumbled over here different web page and thought I may as well check things out. I like what I see so i am just following you. Look forward to looking into your web page for a second time.
Comentariu postate de michael kors handbags la data de 15.05.2019
I have to show appreciation to this writer just for bailing me out of this circumstance. Right after looking out through the world wide web and obtaining tricks that were not pleasant, I assumed my entire life was over. Being alive without the presence of approaches to the difficulties you have sorted out as a result of your short post is a crucial case, and the kind that would have in a wrong way damaged my career if I had not encountered your web blog. The talents and kindness in controlling a lot of things was precious. I don't know what I would have done if I hadn't discovered such a point like this. I'm able to at this point look forward to my future. Thanks for your time so much for your expert and result oriented guide. I will not think twice to recommend your site to anybody who needs to have guide on this problem.
Comentariu postate de minecraft free download pc la data de 16.05.2019
Ahaa, its nice dialogue about this piece of writing here at this weblog, I have read all that, so now me also commenting at this place.
Comentariu postate de mojang minecraft download la data de 16.05.2019
Asking questions are really good thing if you are not understanding something completely, but this paragraph provides nice understanding yet.
Comentariu postate de minecraft download free pc la data de 17.05.2019
Hi there! This is my first comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading your articles. Can you suggest any other blogs/websites/forums that deal with the same topics? Thank you!