Vous pouvez obtenir une telle configuration à l'aide de nouvelles installations de CSS3, à savoir rayon frontière et forme gradient de l'image d'arrière-plan. Vous pouvez trouver des informations sur ceux qui sont partout sur Internet, par exemple background gradient et border radius.
Ci-dessous est par exemple, il ne fonctionnera pas dans tous les navigateurs, et n'est pas exactement ce que vous voulez, mais il devrait être suffisant pour vous donner l'idée de base:
La structure html pourrait ressembler à ceci:
<div id="big_div">
Search for a hotel
<div id="small_white_div">
Some other content
</div>
</div>
Et le correspondant css serait:
#big_div {height:450px;width:250px;border-radius: 5px;background-color:red;
background-image: linear-gradient(bottom, rgb(33,51,140) 5%, rgb(125,187,209) 51%,
rgb(33,51,140) 100%);
background-image: -o-linear-gradient(bottom, rgb(33,51,140) 5%, rgb(125,187,209) 51%,
rgb(33,51,140) 100%);
background-image: -moz-linear-gradient(bottom, rgb(33,51,140) 5%, rgb(125,187,209)
51%, rgb(33,51,140) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(33,51,140) 5%, rgb(125,187,209)
51%, rgb(33,51,140) 100%);
background-image: -ms-linear-gradient(bottom, rgb(33,51,140) 5%, rgb(125,187,209) 51%,
rgb(33,51,140) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.05, rgb(33,51,140)),
color-stop(0.51, rgb(125,187,209)),
color-stop(1, rgb(33,51,140))
);}
#small_white_div {height:400px;width:220px;margin:auto;border-radius:5px;
background-color:white;margin-top:20px;}
Bonne chance.
que voulez-vous dire par "lisse"? http://border-radius.com/ – Aprillion
@deathApril: Je pense qu'il veut dire le gradient. –
duplication possible de [CSS3 Gradient Borders] (http://stackoverflow.com/questions/2717127/css3-gradient-borders) –