Web Design Week 5
25/9/17 Week 5
Kamal Afiq [0330643]
Web Design & New Media
Week 5
Kamal Afiq [0330643]
Web Design & New Media
Week 5
Lecture Notes
Week 5 Lecture
Old HTML used generic tags. HTML5 uses new Semantic elements like <Footer> and <Header>. These semantic elements can tell developers how to separate information. Id and Class attributes can be used to identify information and content.
ID attribute
Every HTML carries ID attributes. It is used to identify elements from others on a page. No two elements can have the same ID attribute.
Class attribute
Every HTML element can also carry a class attribute. Several elements can be identified from others on a page.
They can be used like this:
<img src="images/randomimage.jpeg" class="classname"/>
<img src="images/randomimage.jpeg" id="idname"/>Using these attributes doesn't actually change how they look on the page. It only changes if there is a CSS rule that indicates that they should be displayed differently.
Block elements
Elements that force the content to go to a new line, e.g. <h1>, <p>, <ul>, <li>
Inline elements
Elements that continue in the same line, e.g. <b>, <i>, <em>, <img>
Cascading Style Sheet (CSS)
Allows you to create rules to specify how content appears. A selector includes a selector and a declaration. The declaration has a property and value. Selectors indicate what the changes are being applied to. The same rule can apply to more than one element if you separate the element names with commas. < > is used for HTML while CSS is kept within { } or Curly Braces.h1, h2, h3 { font-family: 'Baloo', cursive: color; #FFFFFF; font-size:2em;}
Precidence occurs when a HTML document has various CSS rules to choose from.
Comments
Post a Comment