HTML 5 Interview Questions & Answers. There is a huge demand for HTML 5 Jobs in reputed organizations for top positions like HTML5 Developer, UI Developer, HTML Developer, Front End Developer, Graphic & Web Designer, HTML Programmer, UX Designer, Software Developer etc. Visit our HTML 5 job interview questions and answers page designed. Here's an interview question that definitely requires an answer relevant to the job. If you say your biggest achievement was improving throughput by 18 percent in six months but you're interviewing for a leadership role in human resources. That answer is interesting but ultimately irrelevant.
A class is a style (i.e., a group of CSS attributes) that can be applied to one or more HTML elements. This means it can apply to instances of the same element or instances of different elements to which the same style can be attached. Classes are defined in CSS using a period followed by the class name. It is applied to an HTML element via the class attribute and the class name.
The following snippet shows a class defined, and then it being applied to an HTML DIV element.
.test {font-family: Helvetica; font-size: 20; background: black;}
The following snippet shows a class defined, and then it being applied to an HTML DIV element.
.test {font-family: Helvetica; font-size: 20; background: black;}
test
Also, you could define a style for all elements with a defined class. This is demonstrated with the following code that selects all P elements with the column class specified.
p.column {font-color: black;}
An ID selector is a name assigned to a specific style. In turn, it can be associated with one HTML element with the assigned ID. Within CSS, ID selectors are defined with the # character followed by the selector name.
The following snippet shows the CSS example1 defined followed by the use of an HTML element’s ID attribute, which pairs it with the CSS selector.
#example1: {background: blue;}
p.column {font-color: black;}
An ID selector is a name assigned to a specific style. In turn, it can be associated with one HTML element with the assigned ID. Within CSS, ID selectors are defined with the # character followed by the selector name.
The following snippet shows the CSS example1 defined followed by the use of an HTML element’s ID attribute, which pairs it with the CSS selector.
#example1: {background: blue;}
What are differences between DIV and SPAN?
DIV is used to select a block of text so that one can apply styles to it. SPAN is used to select inline text and let users to apply styles to it. The main difference between DIV and SPAN is SPAN does not do formatting by itself. Also the DIV tag is used as a paragraph break as it creates a logical division of the document in which it is applied. This is in contrast to the SPAN as SPAN simply dos the...Arjya Bhattacharya
- Sep 27th, 2016
< div > is used for denoting divisions in a paragraph in HTML.