Jump to content
  • 0

Можно ли затемнить, или высветлить один край бэкграунда в диве.


Archer_x
 Share

Question

Я создал див для шапки сайта и сделал темный фон для нее, можно ли нижний кран высветлить или сделать прозрачным с помощью каскадных таблиц стилей, или только с помощью редактирования фонового изображения в фотошопе. Заранее спасибо.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

представьте, что у вас есть краски, кисти, карандаши, мелки...

вы можете нарисовать все что захотите, и чем захотите...

подумайте хорошенько и реализуете это легко, вот в качестве примера


<style>
*{padding:0px;margin:0px;}
.body1{padding:20px;background:#fff;}
.body2{padding:20px;background:#999;}
.header
{
position:relative;
height:100px;
background:#bbb;
}
.gradient1
{
position:absolute;
left:0px;
right:0px;
bottom:0px;
background: #bbb;
background: -moz-linear-gradient(top, #bbb, #fff);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bbb), color-stop(100%,#fff));
background: -webkit-linear-gradient(top, #bbb, #fff);
background: -o-linear-gradient(top, #bbb, #fff);
background: -ms-linear-gradient(top, #bbb, #fff);
background: linear-gradient(top, #bbb, #fff);
padding-top:10px;
}
.gradient2
{
position:absolute;
left:0px;
right:0px;
bottom:-10px;
background: #bbb;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,bbb), color-stop(100%,transparent));
background: -webkit-linear-gradient(top, #bbb, transparent);
background: -moz-linear-gradient(top, #bbb, transparent);
background: -o-linear-gradient(top, #bbb, transparent);
background: -ms-linear-gradient(top, #bbb, transparent);
background: linear-gradient(top, #bbb, transparent);
padding-top:10px;
}
</style>
<div class="body1">
<div class="header">
шапка1
<div class="gradient1"></div>
</div>
</div>
<br><br>
<div class="body2">
<div class="header">
шапка2
<div class="gradient2"></div>
</div>
</div>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy