CSS elements not displaying properly in Webpages

Funny to say, working with HTML, you must have come across some series of codes that just makes things unbearable, especially when you want your website to display exactly alike in all browser. In so many ways, i had often tried to induce CSS Hack in my code to make it compatible with other Major browsers such as Internet Explorer, Mozilla, Chrome & Safari. well this often leads the page to display in a way that i felt wasn’t good enough. I found out that, using the IE comment tag <!--[if IE]--> some HTML code that only IE will pick up <!--[endif]--> on my Web pages i could only affect the IE browser, of which Mozilla being the best always display what i always want, but Chrome and Safari are left out in the scenario. To be able to work about that, i tried using other scripts and code i found online but nothing seems to be working exactly the way i wanted, so the best option i would advice anyone who is trying to work around CSS in their HTML code, i would suggest you code properly and precisely. in such a way that your codes will execute properly and you’ll not require the CSS hacks.
Consequently when designing your webpage, if you try to provide support for other browsers, maybe hand held devices or even mobile devices, in your CSS code, try making the “media” attribute in your <link> tag to be set to the precise device you’re targeting.
Examples of Media attributed values.

  • all – for all devices
  • braille – for feedback devices
  • embossed – for paged printers
  • handheld – for hand held or mobile devices
  • print – for printers or view mode before printing
  • projection – for projection like presentation or display
  • screen – for computer screens
  • speech – for speech synthesizers
  • tty – for fixed-pitch type character grid (teletype i.e.don’t use “px” as measurement with this media).
  • tv – for television like devices

Example: of usage


@media handheld{
  div { color: blue; }
}

0

About Charming Prince

Being a Web Developer/Web Author, i had an idea to disseminate my knowledge in the field of web development to other people by opening this online free tutorials on programming languages, in so doing, to share ideas where applicable...As well as to share ideas in related area pertaining to information dissemination and media such as Movies, Music , and Games. as per these are the areas which i like the most and i think most people do like this area as well, so I'll try to make my explanation short but concise...
This entry was posted in Programming, Tutorial and tagged , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar Custom avatar