Solved

HTML 5 and Css

Posted on 2013-02-02
3
168 Views
Last Modified: 2013-02-02
Hello folks,

   I have a page in which I am converting to use HTML 5. As such, I am creating a css for it. The existing web page uses the <div align="center"> and I am stumped as to what the equalivent would be in CSS. It will have an image and I want it to be centered on the page displayed to the viewer.
Your help is appericiated. :)
0
Comment
Question by:Overthere
3 Comments
 
LVL 11

Accepted Solution

by:
MajorBigDeal earned 500 total points
ID: 38847032
www.w3.org/Style/Examples/007/center.en.html

P.blocktext {
    margin-left: auto;
    margin-right: auto;
    width: 6em
}
0
 
LVL 6

Expert Comment

by:nickinthooz
ID: 38847064
#div {
text-align:center;
padding: 10px;
}

Open in new window


you can do it with other tags but make sure they are the same size as your div in order to find a true center.

For Example:
#mydiv {
width:300px;
height:300px;
text-align: center;
border:dashed;
}
#p {
width: 280px;
padding: 0 10px 0 10px;
}

Open in new window

<div id="mydiv"><p>this is your centered text</p></div>

Open in new window

Here is a jfiddle example of it.
0
 

Author Closing Comment

by:Overthere
ID: 38847442
Thank all of you for responding. The link provided by MajorBigDeal was excellent and very helpful.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is the normal amount of queries 5 80
Question on web subscription for apps 3 115
Problem to echo 6 109
Cordova Camera plugin fails 2 141
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa‚Ķ
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question