Click here to Skip to main content
Click here to Skip to main content

Writing conditional logic via CSS

, 30 Mar 2010
Rate this:
Please Sign up or sign in to vote.
Sometimes we face some UI problem like for example We need a line break in Internet Explorer 7. But we don't need that for other browser.This can be done in many ways but i got a interesting solution of this.write a CSS like this.breakOnlyInIE7{ display:none;...
Sometimes we face some UI problem like for example
 
We need a line break in Internet Explorer 7. But we don't need that for other browser.
 
This can be done in many ways but i got a interesting solution of this.
 
write a CSS like this
 
.breakOnlyInIE7
{
 display:none;
 *display:block;
}
 

and write a new line html code like below
 
<br class="breakOnlyInIE7" />
 
That is our very known <br /> tag with a CSS class containing IE7 specific CSS Hack.
 
The above code will render <br /> tag only in IE7 and for rest of the browser no new line tag will be rendered! Wink | ;)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Mahmudul Haque Azad
Software Developer (Senior) Vizrt Bangladesh
Bangladesh Bangladesh
I am truly versatile and 360 degree Engineer having wide range of development experience in .NET and Java Platform. I am also proficient in system level programming in C++. To me technology is not at all a problem, it’s the client requirement that matters! That is I am ready and comfortable to use any technology to make the business of my client a success.
 
In my five years of experience I have the opportunities to work for fortune 500 companies of US and many renowned clients from Europe.
 
My Linkedin Profile: http://bd.linkedin.com/in/mahmudazad
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 30 Mar 2010
Article Copyright 2010 by Mahmudul Haque Azad
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid