Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa HTML Vertically center page
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
Vertically center page
2 Answer(s)      3 years and 7 months ago
Posted in : HTML


I know how to center the text of the page Horizontally ..but is it possible to vertically center page in HTML or CSS?


Advertisement
View Answers

March 14, 2011 at 6:39 PM


You can set the Height, width and left, right alignment for the text in CSS as given below...

Vertically center page in CSS

.className{
    width:300px;
    height:200px;
    position:absolute;
    left:50%;
    top:50%;
    margin:-100px 0 0 -150px;
}


March 14, 2011 at 6:40 PM


Vertically center page in JQuery

$(window).resize(function(){

    $('.className').css({
        position:'absolute',
        left: ($(window).width() - $('.className').outerWidth())/2,
        top: ($(window).height() - $('.className').outerHeight())/2
    });

});

// To initially run the function:
$(window).resize();


Related Tutorials/Questions & Answers:
Vertically center page
Vertically center page  I know how to center the text of the page Horizontally ..but is it possible to vertically center page in HTML or CSS?  ... as given below... Vertically center page in CSS .className{ width:300px
Mozilla Developer Center
Mozilla Developer Center       Great site to get a first look at AJAX. Read full Description
Advertisements
Open Source Media Center
Open Source Media Center Open source media center for Windows Why buy a Media Center PC when you can make your own - fun project for an old PC "Media Portal turns your PC in a very advanced Multi-Media Center / HTPC
center a table
center a table  How do I center a table
window in center
window in center  if i run the programme thw window is in lie in top left corner i want a window open in center
Showing div at the center of the webpage
Showing div at the center of the webpage  Showing div at the center of the webpage
jquery dialog box center
jquery dialog box center  How to create dialog box with center alignment in jquery..?   $('my-selector').dialog('option', 'position', 'center
how to display the image in center - Ajax
how to display the image in center  i want to dispaly the image as center of the screen using javascript..while i am clicking the button ..any one give me the code for this one
How to center a frame
How to center a frame In this tutorial, you will learn how to center a frame... and minimize also. Here we are going to center the frame on the screen. The best way to do this is to use the java.awt.Toolkit api. The given code center
PHP GD center text
- 1, $border); $text = 'This is the text which is center of image..._width = $font_width * strlen($text); $position_center = ceil(($width..., $position_center, $position_middle, $text, $textcolor); header("Content-type
minor project on service center management in core java
minor project on service center management in core java  I need a minor project on service center management in core java...If u have then plz send me
jsf center tag needed - Java Server Faces Questions
jsf center tag needed  which tag we have to use for center in JSF. normally in html we are using tag. like that i need my submitt button in center in my JSF page. give me the solution. thanks in advance.  Hi friend
How can I Define a JFrame subclass that has four vertically positioned buttons. - Java Beginners
How can I Define a JFrame subclass that has four vertically positioned buttons.  How can I Define a JFrame subclass that has four vertically positioned buttons. The labels for the four buttons are Senior, Junior, Sophomore
How to display the font in center
How to display the font in center       This section illustrates you how to display the font in center. To display the font in center, the method paint() is defined
Java Help Center
Java Help Center       Welcome to Java help Center service of RoseIndia.net, a renowned Java tutorial website that provides you the latest and up
How to attach file to HP Quality Center [QC] using java
How to attach file to HP Quality Center [QC] using java  Hello All, Do any one know how to upload attachments to QC Test Case Run Instance using java In QC we have <BR> Test Lab<BR> |_Test Set Instcance<
how can i draw line between two panel contaning circle and line between their center?
how can i draw line between two panel contaning circle and line between their center?   how can i draw line between two panel contaning circle and line between their center
jsp page
jsp page  <%@ page language="java" contentType="text/html; charset...;tr> <td width="800"><p align ="center"></p></td> </tr> </table> <table align="center" border="3
login page
login page  code for login page
Preload Page
Preload Page  How do I make a page that loads my other html page and then goes to the html page once it's done loading? I need the page to say Please Wait
log in page
log in page  hi all i want to create a login page in jsp which should be validated using ajax. please help me dong that with code...   Here...;tr> <td colspan="2" align="center" width="275"><input type="button
Login page
Login page  how to create Login page in java
Rendering of page
Rendering of page  What does it mean by rendering of page in JSF
home page
home page  Develop home page using swings and awt components
home page
home page  Develop home page using applets and swings
web page
web page  1.Create a web page with the following using HTML i) To embed an image map in a web page ii) To fix the hot spots iii) Show all the related information when the hot spots are clicked
WEB PAGE
WEB PAGE  How To Create A Simple web Page Of a gmail using applet
page downloading
page downloading  down loading code for file existed in webbrowser like one text document placed in web browser please help me friend
Login Page
Login Page  Can anyone tell me the steps to create a login page in myeclipse 7.0 and validating it with login database in db2 9.7 ??? Please tell me
divide a page
divide a page   how to divide a page using jsp in three different column and in which , in first column , there is a phone number box,whenever a phone numhber is given immediately it will shown in below of the phone box
Advertisements
 

 

 

DMCA.com