• +91 9723535972
  • info@interviewmaterial.com

CSS Interview Questions and Answers

Related Subjects

Question - Which style specification method should be used? Why?

Answer - The answer to this one is tricky. The short answer is: "it depends." The long answer is, however, another story. If you are planning on using more than one style specification method in your document, you must also worry about Cascading Order of Style methods (see question 11.) If you are going to use only one method, then some guidelines about the nature of each method need to be kept in mind. The answer to this question is also very much related to the advantages and disadvantages to using each of them (next question.) Method 1: External Style Sheets (The LINK [-->Index DOT Html] element) This method should be used if you want to apply the same style to multiple documents. Each document can reference the stand-alone style sheet and use the styles contained within. Using this method, the appearance of many documents can be controlled using a single or small number of style sheets. This can save a LOT of time for an author. Method 2: Embedded Style Sheets (The Style [-->Index DOT Html] element) The syntax used with Method 2 is the same as that for Method 1. This method is a happy medium between External Style Sheets and Inline Styles (see below.). It should be used in place of Method 1 if you only want to specify styles for a single document. This method should also be used when you want to specify a style for multiple tag types at once or the list of style definitions is of larger size. Method 3: Inline Styles (STYLE attribute to HTML elements) If you only have to apply style to one or a few elements in a single document, your best bet will often be an Inline Style. This method attaches a style definition within the HTML element it is modifying. Justified Text? You redefine the

tag like: p {text-align: justify;} and that renders all

s with justified text. Another possibility is to define a class, like: .just {text-align: justify;} and then you style the paragraphs in question like: text Note that NN 4.xx has problems with the inheri

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners