
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to horizontally center a in another ?
Here I have one html form and one css file(style.css).”o-div” is the outer div and “i-div“is the inner div class.
Example
<html >
<head>
<title>center a div</title>
<link href="../../Content/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="o-div">
I am OUTER DIV
<div class="i-div">
I am INNER DIV,
I am in Center
</div>
</div>
</body>
</html>
Output
I am OUTER DIV
I am INNER DIV, I am in Center
Style.css
body {
background-color:Gray;
padding:30px;
}
.o-div {
padding:50px;
background-color:Lime;
}
.i-div {
background-color:Fuchsia;
max-width:400px;
height:200px;
margin: 0 auto;
text-align:center;
}
- Related Articles
- How to center a div within another div?
- How can I center text (horizontally and vertically) inside a div block?
- How to set div position relative to another div in JavaScript?
- How to make a div center align in HTML?
- How to copy the content of a div into another div using jQuery?
- How to center a div on the screen using jQuery?
- How to position horizontal scroll bar at center of DIV?
- How to center a <div> using CSS grid Property?
- Center Triangle at Bottom of Div in HTML with CSS
- How can I vertically center a div element for all browsers using CSS?
- How to center a <div> using the Flexbox property of CSS?
- Find:$(i).\ 7 \div 3.5$$(ii).\ 36 \div 0.2$$(iii).\ 3.25 \div 0.5$ $(iv).\ 30.94 \div 0.7$$(v).\ 0.5 \div 0.25$$(vi).\ 7.75 \div 0.25$ $(vii).\ 76.5 \div 0.15$$(viii).\ 37.8 \div 1.4$$(ix).\ 2.73 \div 1.3$
- Find:$(i).\ 0.4 \div 2$$(ii).\ 0.35 \div 5$$(iii).\ 2.48 \div 4$ $(iv).\ 65.4 \div 6$$(v).\ 651.2 \div 4$$(vi).\ 14.49 \div 7$ $(vii).\ 3.96 \div 4$$(viii).\ 0.80 \div 5$
- Evaluate the following:$[(-100) \div 20] \div [25 \div (-5)]$.
- How to horizontally center a widget using a grid() in Tkinter?
Advertisements
?
Here I have one html form and one css file(style.css).”o-div” is the outer div and “i-div“is the inner div class.
Example
<html > <head> <title>center a div</title> <link href="../../Content/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="o-div"> I am OUTER DIV <div class="i-div"> I am INNER DIV, I am in Center </div> </div> </body> </html>
Output
I am OUTER DIV I am INNER DIV, I am in Center
Style.css
body { background-color:Gray; padding:30px; } .o-div { padding:50px; background-color:Lime; } .i-div { background-color:Fuchsia; max-width:400px; height:200px; margin: 0 auto; text-align:center; }
- Related Articles
- How to center a div within another div?
- How can I center text (horizontally and vertically) inside a div block?
- How to set div position relative to another div in JavaScript?
- How to make a div center align in HTML?
- How to copy the content of a div into another div using jQuery?
- How to center a div on the screen using jQuery?
- How to position horizontal scroll bar at center of DIV?
- How to center a <div> using CSS grid Property?
- Center Triangle at Bottom of Div in HTML with CSS
- How can I vertically center a div element for all browsers using CSS?
- How to center a <div> using the Flexbox property of CSS?
- Find:$(i).\ 7 \div 3.5$$(ii).\ 36 \div 0.2$$(iii).\ 3.25 \div 0.5$ $(iv).\ 30.94 \div 0.7$$(v).\ 0.5 \div 0.25$$(vi).\ 7.75 \div 0.25$ $(vii).\ 76.5 \div 0.15$$(viii).\ 37.8 \div 1.4$$(ix).\ 2.73 \div 1.3$
- Find:$(i).\ 0.4 \div 2$$(ii).\ 0.35 \div 5$$(iii).\ 2.48 \div 4$ $(iv).\ 65.4 \div 6$$(v).\ 651.2 \div 4$$(vi).\ 14.49 \div 7$ $(vii).\ 3.96 \div 4$$(viii).\ 0.80 \div 5$
- Evaluate the following:$[(-100) \div 20] \div [25 \div (-5)]$.
- How to horizontally center a widget using a grid() in Tkinter?

Advertisements