Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa HTML Div file in css
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
Div file in css
1 Answer(s)      3 years and 8 months ago
Posted in : HTML


How can i indent div with outer and inner margin?


Advertisement
View Answers

March 17, 2011 at 12:42 PM


You need to wrap it in another div. For example, make the outer div margin: 0 auto; and the inner div margin-left: 50px

That will indent its left margin by 50 pixels from the middle.

Indent div in css

<html>
<head>
    <title>Indent div in css</title>
    <style>
        #outer {
            margin: 0 auto; 
            width:200px;
            background-color:red; 
        }

        #inner {
            /*move the whole container 50px to the left side*/
            margin-left:-50px; 
            margin-right:50px;
            /*or move the whole container 50px to the right side*/
            /*
            margin-left:50px; 
            margin-right:-50px;
            */
        }
    </style>
</head>
<body>
<div id="outer">
    <div id="inner">
        This is the result!
    </div>
</div>
</body>
</html>


Related Tutorials/Questions & Answers:
div align left css
div align left css  Hi, How to align the div to left using the css in HTML page. Thanks
indent div css
Div file in css  How can i indent div with outer and inner margin.... Indent div in css <html> <head> <title>Indent div... it in another div. For example, make the outer div margin: 0 auto; and the inner div
Advertisements
indent div css
/answers/viewqa/HTML/17553-indent-div-css.html :Indent DIV in CSS...indent div css  How can i indent with outer and inner margin?  
regarding css file in my eclipse
regarding css file in my eclipse  hai frns i want a small help frm u.when ever i use css file in html or normal web browsers the output is coming means css file is effecting the output but wen i use the same code in myeclipse
How to make a horizontally Scrollable grid in jsp using div, table, css, javascript?
How to make a horizontally Scrollable grid in jsp using div, table, css, javascript?  In a jsp page InsertUpdate.jsp (say) there is a button Insert to Save data in the database.I want that on clicking Insert button, besides
CSS
CSS  Make a navigation button using a div with a link inside it. Give it a border, background, and text color, and make them change when the user... style sheet validates at Note that some warnings may be unavoidable, but your CSS
Getting Parameter from a css styled jsp file to a java servlet file...
Getting Parameter from a css styled jsp file to a java servlet file... .../css" media="screen" /> <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
How to align div side by side?
will explain you how you can align the div side by side using CSS. The CSS... a container DIV and then put any number of DIV inside the container div and using CSS all these div's get aligned side by site. Here is the code of the CSS
passing values between jsp file through hyperlink in div tag
passing values between jsp file through hyperlink in div tag  <... type='text/css' rel='stylesheet' href='/css/crec.css' /&gt; &lt...; &lt;/tr&gt; &lt;/table&gt; &lt;br&gt; &lt;div
passing parameter from Java code to CSS file - Design concepts & design patterns
passing parameter from Java code to CSS file  hi, i have to pass a string variable from by java code to a CSS file so that i can use that variable in my CSS file. Plz help me as soon as possible
Implementing CSS and JavaScript in JSP File
Implementing CSS and JavaScript in JSP File..., the following code imports style.css file from css folder <link rel="... file is used for field validation. Directory Structure of css and script
CSS in flex
dynamically loading of CSS file is not supported in flex. you can compile the CSS file in swf and use it dynamically in your application. Loading style sheets at run time is a three-step process: 1. Write a CSS file for your application
DIV in HTML
DIV in HTML  What is DIV in HTML
Working with CSS(CSS Manipulation)
Working with CSS(CSS Manipulation)       Working with CSS(CSS Manipulation) These methods are used to manipulate CSS specially by getting and setting
HTML CSS
HTML CSS  Explain in brief about the term CSS
CSS ScrollBar Properties
CSS ScrollBar Properties  How can i set ScrollBar properties in CSS? I am using HTML, CSS and Div in my code. Thanks!!   overflow: scroll; overflow-y: scroll; overflow-x: scroll; overflow:-moz-scrollbars-vertical
CSS Apply
CSS Apply  How can I apply different CSS to my application for background by taking CSS list in Select tag i.e. Combo box. for e.g As in Orkut we select theme & by clicking to apply it changes background theme & color
css
css
css
CSS in Flex
CSS in Flex  Hi...... Please tell me How do you use css styles in flex? Thanks  Ans: @namespace s "library://ns.adobe.com/flex/spark"; @namespace mx "library://ns.adobe.com/flex/mx"; .button{ font
Include CSS in HTML
Include CSS in HTML  Can any one tell me how to include a CSS file into my HTML page. A code format to include the CSS will work. Thanks in Advance.   Include CSS in HTML To include a CSS or Style Sheet into you HTML
HTML CSS example
-color: lightgrey; } p { color:red; } </style> To include css file...HTML CSS example  Hi, Can anyone share the HTML CSS example code. I my HTML web page I have to embed the CSS style. Share some HTML CSS example
jQuery To Hide the Div
to develop the Hide of a Div . Step 1:       Create a new file... on the div and having correponding style css. divClass .deleteDiv { position... jQuery To Hide the Div      
css click box
css click box  I wanted to create a click box in CSS with a hyperlink that should appears flat.   Find the below given code.. In your HTML file .. click box Text CSS a { display:inline-block; width:30px
Showing div at the center of the webpage
Showing div at the center of the webpage  Showing div at the center of the webpage
What are the advantages and disadvantages of CSS?
What are the advantages and disadvantages of CSS?  What are the advantages and disadvantages of CSS
CSS Editor
at-rules and selectors in a CSS file selectable, pluggable CSS profiles... CSS Editor         This project aims to contribute sophisticated CSS authoring
jQuery CSS Selector
jQuery CSS Selector       jQuery CSS Selector In this section we are learning about the jQuery CSS Selector. The CSS Selectors is the powerful API provided
class of div tag
class of div tag  How can i recognize the selected DIV class
div background color in html
div background color in html   How to change the background color of DIV in HTML
 

 

 

DMCA.com