Try being explicit about all the border properties. For example:
border:1px solid black;
See Border shorthand property. Although the other bits are optional some browsers don't set the width or colour to a default you'd expect. In your case I'd bet that it's the width that's zero unless specified.
Answer from Paolo on Stack Overflowcss - How to set a border for an HTML div tag? - Stack Overflow
css - How do I add a border to an image in HTML? - Stack Overflow
Text in Border CSS HTML - Stack Overflow
html - how to make a border around content - Stack Overflow
Videos
Try being explicit about all the border properties. For example:
border:1px solid black;
See Border shorthand property. Although the other bits are optional some browsers don't set the width or colour to a default you'd expect. In your case I'd bet that it's the width that's zero unless specified.
You can use:
border-width:2px;
border-style:solid;
border-color:black;
or as shorthand:
border: 2px solid black
Yes, but it's not a div, it's a fieldset
fieldset {
border: 1px solid #000;
}
<fieldset>
<legend>AAA</legend>
</fieldset>
You can do something like this, where you set a negative margin on the h1 (or whatever header you are using)
div{
height:100px;
width:100px;
border:2px solid black;
}
h1{
width:30px;
margin-top:-10px;
margin-left:5px;
background:white;
}
Note: you need to set a background as well as a width on the h1
Example: http://jsfiddle.net/ZgEMM/
EDIT
To make it work with hiding the div, you could use some jQuery like this
$('a').click(function(){
var a = $('h1').detach();
$('div').hide();
$(a).prependTo('body');
});
(You will need to modify...)
Example #2: http://jsfiddle.net/ZgEMM/4/
I cleaned up the HTML a bit, and the border is working fine jsFiddle:
<div class="ghassar">
<div id="op">
<label>Number of days</label>
<select name="days">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
<div id="add-to-basket">
<input type="submit" value="Add to the basket" name="rent" id="buttom1" />
</div>
</div>
and how can i make space between the content without using the tag
<br>
You can use margins, like I did here:
#add-to-basket { margin: 50px auto; position: relative; }
and for the div tag shall i use class or id
It depends on what you're doing. Elements on the page can't share the same id, but multiple elements can have the same class.
Update: As mentioned in the other answers, you should also set the border color if you don't want the default. You can do that either with the shorthand way:
border:2px solid #f00; /* #f00 is the color red*/
or
border-color: #f00
.ghassar{
width:300px;
margin-left: 600px;
padding:10px 40px;
border:solid 1px #CCC;
border-radius:25px;
}
Try to keep your code tidier, please.
You forgot to add a color to your border property.