Solved

HTML 5 and Css

Posted on 2013-02-02
3
162 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
The viewer will learn how to dynamically set the form action using jQuery.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now