mod_rewrite module allows to manipulate url using unlimited number of rules . Each rule consist of unlimited number of condition

  • Problems

    This line enable URL Rewriting . It must be enabled via the RewriteEngine directive! and if your .htaccess file is going to use rewrite rules, you should always include this line. Otherwise, you can’t be sure if its enabled or not. The string “on” is case insensitive.

Syntax

VERTICAL AND HORIZONTAL CENTERING BLOCK LEVEL ELEMENT.
1)VERTICAL CENTERING:
Html:      
     <div id="xyz">Your Content Here</div>
      
style:
     #xyz{position:absolute;top:50%:height:500px;margin-top:-250px;}

Here, top left corner of div will be positioned 50% from top . Since we want the center of the div
to be positioned 50% from the
top you need to set a negative top margin equal to half the height of the div.

2)HORIZONTAL CENTERING:
First Way:
Html:      
     <div id="xyz">Your Content Here</div>
      
style:
     #xyz{position:absolute;left:50%;width:800px;margin-left:-400px;}


Second Way:
For this you need 3 things:
1)Set Width
2)Set left and right margins to auto
3)Proper doctype
Html:      
     <div id="xyz">Your Content Here</div>
      
style:
     #xyz{width:1000px;margin-left:auto;margin-right:auto;}

You can also center entire webpage , Just keep all HTML tags inside single <div> tag.

3)VERTICAL AND HORIZONTAL CENTERING: For horizontal  and vertical centering combine both of top.

4)VERTICLE CENTERING TEXT WITH LINE-HEIGHT:
 If you want to vertically center text within a containing block who's height is fixed , simply set
 line height of the text to be same as the height of containing block

eg:
Html:      
     <div id="xyz">Your Content Here</div>
      
style:
     #xyz{height:35px;line-height:35px;}



No comments:

Post a Comment