Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HTML 5 and Css

Posted on 2013-02-02
3
Medium Priority
?
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
MajorBigDeal earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

715 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