Jump to content
xisto Community
Sign in to follow this  
web_designer

Make Your Layout Look Better With Css… Try These 5 Css Properties… css properties

Recommended Posts

This is my first post and I want to share with a little bit about CSS. These CSS properties very useful, but I think it used rarely. these are: clip, min-height, white-space, cursor, and display the amazing thing about them that are widely supported by all browsers.

 

Let's start…

 

1- clip:

 

It works like a mask. That means it masks the content of the element in a rectangle shape. To use this property we should set the position to absolute, set the top, right, bottom and left to relative

 

Ex:

 

?

.clip {  position: relative;  height: 250px;  width: 400px;  border: 1px solid #0000;}.clip img {  position: absolute;  clip: rect(50px 160px 100px 50px);} ?

 

2- Min-height:?

 

This property allows us to specify the minimum height of the element. This is very useful when we want to balance our layout.

 

Ex:

 

?

.minheight {  min-height: 600px;}
The problem appears when we use the browser ie6. ie6 doesn't support this property but, don’t worry there is a hack.
.minheight {  min-height:600px;  height:auto !important;  height:600px;}
?

 

3. White-space:

 

This property specifies how white-space is handled in an element. For example, specify white-space: nowrap will prevent the text from wrapping to next line.

 

Ex:

 

?

em {  white-space: nowrap;}
?

 

4. Cursor :

 

When we change the behavior of a certain button, we should change the cursor too. For example, if we disable a button, then we should changed the cursor as well (to default arrow) to show the user that is not clickable any more.

 

Ex:

 

?

.disabled {  cursor: default;} .busy {  cursor: wait;} .clickable:hover {  cursor: pointer;} ?

 

5. Display inline / block :

 

These two properties are very useful when we try to arrange our layout. Inline elements (like <em>, <span>, and <strong> tags) are rendered on the same line. But bock elements (like <div>, <h1>, and <p> tags) are rendered on a new line.

 

Ex:

 

? .block em {  display: block;} .inline h4, .inline p {  display: inline;}
I wish you find this post useful...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.