Welcome to the IMTalk - Internet Marketing & SEO Forum.
  • Login:
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    arronmattwills is offline IM & SEO Mumbler arronmattwills is on a distinguished road
    Join Date
    Jan 2014
    Location
    India
    Posts
    365
    Thanks Given
    9
    Thanked 12 Times in 11 Posts

    Thumbs up how css gives priority to the classes and IDs in the web design process?

    In my experience I have many freshers, that they writing unwanted classes
    which are really not needed.
    but there is simple logic in css.
    Css gives first priority to the last placed class.
    it means you have applied ten pixels padding to some class.
    later in the ending of the document you again write the class
    with twenty pixel padding.
    Then css give importance to twenty pixels only.
    and if you write !important tag in the css property ending, that is ultimate change. I will
    discuss about that later.
    Here my conclusion is
    'In css last written (last placed) code will gets first priority. '

  2. #2
    wink0r's Avatar
    wink0r is offline Moderator wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold
    Join Date
    Oct 2010
    Location
    East Coast, USA
    Posts
    2,183
    Thanks Given
    941
    Thanked 651 Times in 491 Posts
    This is also followed in the css hierarchy of external stylesheet > internal stylesheet > inline css styles. Inline css will take precedence over other styles listed elsewhere. An internal stylesheet on the page will take precedence over the external stylesheet.

    Also in the hierarchy of tags the body tag will set styles for everything on the page unless overridden by more specific styles. For instance, set the font in the body tag and then you only need to list a font if there is a special case. You could use a class or id for a different font or even an inline css style depending on the case. The same would be true for font color.

  3. #3
    arronmattwills is offline IM & SEO Mumbler arronmattwills is on a distinguished road
    Join Date
    Jan 2014
    Location
    India
    Posts
    365
    Thanks Given
    9
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by wink0r View Post
    This is also followed in the css hierarchy of external stylesheet > internal stylesheet > inline css styles. Inline css will take precedence over other styles listed elsewhere. An internal stylesheet on the page will take precedence over the external stylesheet.

    Also in the hierarchy of tags the body tag will set styles for everything on the page unless overridden by more specific styles. For instance, set the font in the body tag and then you only need to list a font if there is a special case. You could use a class or id for a different font or even an inline css style depending on the case. The same would be true for font color.
    First of all thank you very for your clean and clear and concise theoretical explanation.
    But a professional we designer can write css only in the external style sheet only.
    So while we are dealing with external style sheet how it will take priority, on that I have concentrated.
    But I really like your simple words with good meaning.

  4. #4
    singhabhishek251 is offline IM & SEO Weak Jaw singhabhishek251 is on a distinguished road
    Join Date
    Feb 2013
    Posts
    118
    Thanks Given
    4
    Thanked 7 Times in 7 Posts
    Very nice tutorials for web designers, this is a very good forum for beginners in web designing profession and I think that if a beginner will give some time to explore the topics on this forum, then he can understand the basic and important features.
    website design company in Hyderabad |best urologist in Hyderabad website design hyderabad, best urologist Hyderabad, urologist, website

  5. #5
    arronmattwills is offline IM & SEO Mumbler arronmattwills is on a distinguished road
    Join Date
    Jan 2014
    Location
    India
    Posts
    365
    Thanks Given
    9
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by singhabhishek251 View Post
    Very nice tutorials for web designers, this is a very good forum for beginners in web designing profession and I think that if a beginner will give some time to explore the topics on this forum, then he can understand the basic and important features.
    Yeah, i will try my level best to share the useful and important tips about web design like this small snippets.


 

Similar Threads

  1. What is the meaning of no-js in html website design especially responsive web design?
    By arronmattwills in forum Website Planning, Design & Development
    Replies: 3
    Last Post: 09-11-2014, 04:12 AM
  2. Most important point in responsive web design process.....
    By arronmattwills in forum Website Planning, Design & Development
    Replies: 2
    Last Post: 01-12-2014, 01:45 PM
  3. The role of HTML and CSS in the Web design
    By Delois in forum Website Planning, Design & Development
    Replies: 1
    Last Post: 02-20-2012, 08:55 PM
  4. Web Design - Minimal Use of CSS Will Help Lot
    By Alan Smith in forum Website Planning, Design & Development
    Replies: 0
    Last Post: 11-23-2011, 10:03 AM
  5. How to Tips for Web Page Backgrounds - both HTML and CSS
    By whitegyr in forum Website Planning, Design & Development
    Replies: 3
    Last Post: 11-02-2010, 01:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts