Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

Making a DIV Float Center

div float center

  • Please log in to reply

#1 Ammar11


    Senior Member

  • Designer
  • 197 posts

Posted 04 April 2013 - 02:21 AM

To make a DIV float center do the following:
1.make a style sheet, and define a class type for your DIV.
2. Give it width and float properties. Make the float property value ‘left’ , and set the width property value to a percent of the containing element’s total width.
3.Define a second class type. Set the float property value as ‘left’ and the height property value as 1px or 1%. Calculate your width property value (subtract the width property value of the first class type from 100 % then divide it by two).
4.Save the style sheet as plain text file with ".css" extension.
5.Upload the style sheet to your server.
6.Link the style sheet to the web page you want. To do this add a LINK tag to the HEAD section.
<link rel=”stylesheet” href=”my_style_sheet.css” type=”text/css” />
7.Insert a DIV that uses the second class type in your web page and following it, insert a DIV with the first-class type. This DIV (with the first class type) will be floated to the center.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users