Jump to content

Cand se folosesc @, <, > in CSS?


Xep

Recommended Posts

  • Moderators

Unde ai vazut "<"?

"," se foloseste pentru a aplica aceasi CSS la mai multe elemente, exemplu:

#elem1,
#elem2 {
	color: #ff0000;
}

Ambele elemente vor avea culoarea scrisului rosu.

 

"@" se foloseste pentru a aplica CSS la diferite rezolutii sau tip-uri de device. Exemplu:

body {
    background-color: blue;
}

@media screen and (min-width: 480px) {
    body {
        background-color: red;
    }
}

Toate rezolutiile peste 480px vor avea backgroundu rosu, ce e sub 480px, va avea culoarea albastra.

 

">" se foloseste cand vrei sa alegi doar primu element din interior, exemplu:

div#container > ul {
  border: 1px solid black;
}
<div id="container">
   <ul>
      <li> List Item
        <ul>
           <li> Child </li>
        </ul>
      </li>
      <li> List Item </li>
      <li> List Item </li>
      <li> List Item </li>
   </ul>
</div>

Asta va aplica bordura neagra doar la primu <ul>, nu si la aldoilea care este in primu <li>.

 

Mai multe detalii si metode pentru a selecta un element gasesti aici: http://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize--net-16048

  • Upvote 1

PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

Link to comment
Share on other sites

  • gaby changed the title to Cand se folosesc @, <, > in CSS?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.