Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Html Css Mistakes


Published on

that presentation was presented by Bazlur Rashid as the part of participating in the learning session of teksymmetry/tawar Bangladesh team

Published in: Technology
  • Be the first to like this

Html Css Mistakes

  1. 1. Some Frequent Mistakes made with html and css<br />Bazlur Rashid<br />Tasawr Interactive<br />9th March 2010<br />
  2. 2. Issues to be discussed<br />-Not initializing the tags<br />-By-passing writing css with html<br />-Ignoring Relevant Tags<br />-Not Concentrating on reducing the number of tags<br />-Using inline styling<br />-Writing Identical Styles Separately<br />-Not declaring generic font family. <br />-Not using semantic class names<br />-Using px for font size<br />-Not Using alter tags for images<br />
  3. 3. Not initializing the tags<br />* { <br /> margin: 0;<br /> padding: 0;<br />}<br />a { color: #f00; text-decoration: none}<br />a: hover { color: #0f0; text-decoration: underline}<br />We can also apply various style to other tags like headers, label, textareaand other input types<br />
  4. 4. By-passing writing css with html<br />When need to leave a gap to the top of a box easy to write <div>&nbsp;</div> or <br /> than writing “margin-top” in the css file<br />
  5. 5. Ignoring Relevant Tags<br />Make a div like heading rather using the tags h1, h2 …. <br />Making a div like label, p, span rather using those tags<br />Making a div like label, p, span rather using those tags<br />
  6. 6. Not Concentrating on reducing the number of tags<br />
  7. 7. Using inline styling<br />The ability to add style to a tag by using the style=”" attribute can be handy, but it also sort of defeats the whole purpose of using CSS<br />
  8. 8. Writing Identical Styles Separately<br />It's common to see a style applied to many different elements, even though the style is the same. Leave the style off each separate element and style them all in one go later on, like this:<br />h1, p, #footer, .intro {  font-family:Arial,Helvetica,sans-serif; }<br />
  9. 9. Not declaring generic font family. <br />Often we just write <br />font-family: ‘Myriad Pro’;<br /> instead of <br />font-family: ‘Myriad Pro’, ‘Tahoma’ ,’Arial’;<br />
  10. 10. Not using semantic class names<br />Again going back to being able to easily change <br />the style of a site using CSS, keep in mind that <br />your site will likely change when naming your <br />tag classes. Using the class name “bigyellowbox” <br />might seem like a good idea now, but in a couple <br />of years will it still make sense when you change <br />the colour to blue?<br />
  11. 11. Using px for font size<br />Deprives IE to change the font-size:<br />1em is equal to the current font size. The default <br />text size in browsers is 16px. Set font-size to <br />62.5% in body style if the default font-size to be <br />set is 12px. <br />So, the default size of 1em is 12px.<br />
  12. 12. Not Using alter tags for images <br />Happy to leave like <br /><imgsrc="images/logo.jpg" width="23" height="13" border="0" alt="" /><br /><imgsrc="images/user.jpg" width="23" height="13" border="0" alt=“tasawr" /><br />
  13. 13. Questions ?<br />