css横幅_CSS3:创建网站横幅

news/2024/5/20 21:07:32/文章来源:https://blog.csdn.net/culiao9310/article/details/108866121
css横幅

css横幅

Inspired by Tamsin Baker’s beautiful Photoshop brushes “Urban Scrawl” 1 and 2, I was trying to create some shadowed banners using some CSS3 properties. Visit Tamsin’s site and check out all her inspiring artwork including the free Photoshop brushes: http://www.tamsinbaker.com/

受Tamsin Baker美丽的Photoshop笔刷“ Urban Scrawl” 1和2的启发,我试图使用一些CSS3属性创建一些阴影横幅。 访问Tamsin的网站,并查看她所有鼓舞人心的艺术品,包括免费的Photoshop笔刷: http : //www.tamsinbaker.com/

Here is the result of my experiment with some example banners (click on the image to see the demo page):

这是我的实验结果,带有一些示例横幅(单击图像可查看演示页面):

Click on this image to see a demo
Click on this image to see a demo
点击此图片观看演示

You can download the ZIP file with all the images here: CSS3 Banners ZIP

您可以在此处下载包含所有图像的ZIP文件: CSS3 Banners ZIP

The main idea is to create an image using the Urban Scrawl Photoshop brushes and to put it as the logo of the banner.

主要思想是使用Urban Scrawl Photoshop笔刷创建图像并将其作为横幅的徽标。

The CSS is built up like this:

CSS的构建如下:

h1{
padding-top: 10px;
font-size: 36px;
padding:0px;
margin: 0px;
line-height:100px;
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
width:310px;
float:left;
}
.slogan{
float: right;
margin:75px 20px 0px 0px;
font-size: 20px;
}

Here we define the heading and the slogan of the banner. In the next class we define the general banner layout:

在这里,我们定义横幅的标题和口号。 在下一课中,我们定义常规横幅布局:

.banner{
width:620px;
height: 100px;
margin:7px auto;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
padding-left:190px;
}

And now, we define each individual banner, by changing the background image, which is the logo, the font color and the font-family:

现在,我们通过更改背景图像(即徽标,字体颜色和字体系列)来定义每个单独的横幅:

.banner0{
background: #656964 url(banner0.png) no-repeat center left;
}
.banner1{
color:#37535B;
background: #31B3DA url(banner1.png) no-repeat center left;
font-family: "Arial Narrow";
}
.banner2{
color:#656A64;
background: #81C573 url(banner2.png) no-repeat center left;
font-family: "Palatino Linotype";
}
.banner3{
color:#37535B;
background: #656964 url(banner3.png) no-repeat center left;
font-family: "Arial Narrow";
}
.banner4{
color:#2B8EAC;
background: #656964 url(banner4.png) no-repeat center left;
font-family: "Century Gothic";
}
.banner5{
color:#37535B;
background: #C6CC10 url(banner5.png) no-repeat center left;
font-family: "Trebuchet MS";
}
.banner6{
color:#37535B;
background: #b8d8fb url(banner6.png) no-repeat center left;
font-family: "Arial Narrow";
text-transform: uppercase;
letter-spacing: 4px;
}
.banner7{
color:#6e9cf9;
background: #a08c60 url(banner7.png) no-repeat center left;
font-family: "Arial Narrow";
font-style: italic;
}

The html looks like this:

html看起来像这样:

 <div class="banner banner0"></div>
<div class="banner banner3"></div>
<div class="banner banner1">
<h1>Sweet City</h1>
<div class="slogan">there's a lot to discover in your town</div>
</div>
<div class="banner banner2">
<h1>Automobile</h1>
<div class="slogan">The true fan club</div>
</div>
<div class="banner banner4">
<h1>Arrow Shmallow</h1>
<div class="slogan">Best Services</div>
</div>
<div class="banner banner5">
<h1>Radio Header</h1>
<div class="slogan">Listen to the music!</div>
</div>
<div class="banner banner6">
<h1>Energizer</h1>
<div class="slogan">The Smarter Power</div>
</div>
<div class="banner banner7">
<h1>Brickyton</h1>
<div class="slogan">We build everything</div>
</div>

The first two banners are complete images, but since we apply the general style of .banner to them, we get the rounded and shadowed borders.

前两个横幅是完整的图像,但是由于我们将.banner的一般样式应用于它们,因此我们得到了圆角和阴影边框。

We apply both classes, the .banner and the .bannerN to each element. This will apply the common style and the individual style to the element. Keep in mind, that we can control which property gets overwritten by defining the order of class application. Everything that we define in the individual class .bannerN will replace the property (if it existed) of the .banner class.

我们将.banner和.bannerN这两个类都应用于每个元素。 这会将通用样式和个人样式应用于元素。 请记住,我们可以通过定义类应用程序的顺序来控制哪个属性被覆盖。 我们在单个类.bannerN中定义的所有内容都将替换.banner类的属性(如果存在)。

Here is the demo link again: DEMO

再次是演示链接: DEMO

And also the ZIP: CSS3 Banners ZIP

以及ZIP: CSS3 Banners ZIP

Tamsin Baker’s homepage: http://www.tamsinbaker.com/

Tamsin Baker的主页: http ://www.tamsinbaker.com/

Thank you, Tamsin, and enjoy!

谢谢Tamsin,祝您愉快!

Update Note: There are some issues with older browsers and, of course, Internet Explorer, because of the color depth. To avoid problems of having the image in a slightly different color than the background color of the banner, you should use web colors when creating banners like these…

更新说明:由于颜色深浅,较旧的浏览器以及Internet Explorer当然存在一些问题。 为避免图像的颜色与横幅的背景颜色略有不同,创建此类横幅时应使用网络颜色。

翻译自: https://tympanus.net/codrops/2009/09/06/css3-creating-web-site-banners/

css横幅

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_855199.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

谷歌nexus9刷机_Google Nexus网站菜单

谷歌nexus9刷机View demo 查看演示Download Source 下载源Today I want to show you how to reconstruct the sidebar menu of the Google Nexus 7 page. It slides out with a really nice effect where some subitems get expanded as well. When hovering over a special me…

教你使用“百度统计”黑科技,根据不同维度分析网站的访问质量

废话不多说&#xff0c;先上几张百度统计的分析效果图&#xff1a; 实时访客明细&#xff1a; 今日流量&#xff1a; 跳出率指的是只访问了入口页面&#xff08;例如网站首页&#xff09;就离开的访问量与所产生总访问量的百分比。跳出率计算公式&#xff1a;跳出率访问一个页面…

今天码云(gitee.com)网站打不开,难道被封了?教你正确姿势上码云

今天下午2点50分左右&#xff0c;码云官网&#xff08;gitee.com&#xff09;突然访问不了了&#xff0c;公司代码仓库无法连接使用&#xff0c;不明所以。于是我迅速打开QQ&#xff0c;找到码云官方交流群&#xff0c;发现全国各地已经有很多人在反映这个问题。然后我看到了红…

如何添加百度收录的自动推送代码到帝国CMS网站中

站长近期的收录情况。第一步&#xff1a;获取代码百度资源站点&#xff1a;https://ziyuan.baidu.com 没有站点的要先创建站点。第二步&#xff1a;新增模板变量。变量名随意&#xff0c;我的是&#xff1a;[!--temp.baidu-js-push--]第三步&#xff1a;编辑内容。将第一步里复…

deepin使用Nginx创建站点

配置nginx站点 复制/etc/nginx/conf.d/default.conf 粘贴到当前文件夹&#xff0c;重命名swooletest.conf image.png修改目录和域名 image.png项目根目录创建目录&#xff0c;并且赋予权限 image.png修改/etc/hosts image.png重载nginx sudo nginx -s reloadimage.pngimage.pn…

将线上网站打包成exe可执行文件

1、首先电脑需要有node环境。 去nodejs的官网 https://nodejs.org/en/ 下载&#xff0c;一直下一步就行 检验安装是否成功&#xff0c;cmd命令输入如下命令&#xff0c;出现nodejs的版本号&#xff0c;说明安装成功 npm -v 2、安装nativefier GitHub上开源地址&#xff1a;h…

阿里云账号实名认证、域名实名制与网站备案的区别在哪里

初来乍到的新同学对阿里云账号实名认证、域名实名制与网站备案会比较迷惑&#xff0c;都是实名制又是不同内容。魏艾斯博客会在下面详细解释这三者的不同及如何申请审核。 一、账号实名认证&#xff1a; 根据管局要求&#xff0c;一个阿里云账户只能对应一个主体&#xff0c;为…

阿里云账号实名认证、域名实名制与网站备案的区别是什么

初来乍到的新同学对阿里云账号实名认证、域名实名制与网站备案会比较迷惑&#xff0c;都是实名制又是不同内容。魏艾斯博客会在下面详细解释这三者的不同及如何申请审核。 一、账号实名认证&#xff1a; 根据管局要求&#xff0c;一个阿里云账户只能对应一个主体&#xff0c;为…

阿里云添加网站解析教程

在熟悉了阿里云云解析后&#xff0c;现在我们开始做网站解析&#xff0c;把域名指向服务器IP地址&#xff0c;让网站可访问。说白了是给域名指一条路&#xff0c;到服务器的路。 要想添加域名解析&#xff0c;就要购买域名和服务器。可以都在阿里云上面购买&#xff0c;阿里云是…

阿里云服务器1核1G内存1M带宽可以放几个网站及多少流量 看过来

阿里云服务器1核1G内存1M带宽能放几个网站及多少流量&#xff1f;好多人买了阿里云1核1G内存1M带宽的服务器&#xff0c;却不知道能跑多少流量&#xff0c;也不知道能放几个网站。毕竟都是真金白银买来的&#xff0c;如果在使用期内能够最大限度的利用这个额度&#xff0c;让服…

Window服务器建站图文教程 新手看过来

如果能够有自己的网站&#xff0c;那么该是一件多么荣耀的事情。老魏从20年前就很盼望着能有自己的网站&#xff0c;也曾经在各大网络建立博客。并以能够建立自己的网站为梦想。那时候只知道网站需要服务器和域名&#xff0c;不知道怎么建站&#xff0c;现在陆续操作了下来&…

阿里云轻量应用服务器怎么一键安装ECShop镜像搭建小型电商网站?

阿里云轻量应用服务器能够快捷安装ECShop镜像&#xff0c;搭建小型电商网站。下面来介绍如何使用轻量应用服务器的ECShop镜像搭建一个小型电商网站。 创建服务器 访问轻量应用服务器购买页面&#xff0c;选择ECShop镜像&#xff0c;并选择套餐、购买时长&#xff0c;确认订单支…

阿里云网站ICP备案详细操作步骤教程

依据工信部的要求国内网站必须有备案号才能开通&#xff0c;阿里云网站ICP备案是每个在阿里云搭建网站的用户都要操作的。以下的信息务必真实有效&#xff0c;不能有差错&#xff0c;后面阿里云自查、管局检查出来会给你打回来重新填写&#xff0c;耽误下备案号时间。 如果你使…

网站 https ssl 443 iis 免费证书申请

1.免费ssl证书申请https://letsencrypt.osfipin.com 刚刚注册了一个显示有效期至2020-07-07 07:20:40 2.另外一个。dnspod.cn免费一年ssl证书 3.iis导入证书&#xff1a; https://cloud.tencent.com/document/product/400/35225 进入 “URL 重写” 页面&#xff0c;并单击右…

【Flask】世界杯购票网站开发

效果图 模型设计 class User(db.Model, UserMixin):id db.Column(db.Integer, primary_keyTrue)name db.Column(db.String(20))username db.Column(db.String(20)) # 用户名password_hash db.Column(db.String(128)) # 密码散列值activities db.relationship(Activit…

如何使用fiddler工具替换网站文件

fiddler下载&#xff1a; 链接&#xff1a;https://pan.baidu.com/s/1RaKwgcxZaEfe2NFYgm_t5A 提取码&#xff1a;j8l9 1 &#xff0c; 打开fiddler &#xff0c; 将要替换的网站打开 2 &#xff0c; 在fiddler中找到要替换的文件 3 &#xff0c; 点击右边的AutoResponder 4 …

酷狗音乐网站前端JS的逆向过程

事件背景 前不久我写了一个按歌手爬取酷狗音乐所有歌曲的爬虫&#xff0c;然后在昨天2019年5月10日使用的时候出现了错误&#xff0c;排查问题后发现是获取歌曲相关信息的那个接口做了修改&#xff0c;导致我原有的爬虫失效。在测试后发现&#xff0c;在原有的基础上需要携带C…

假如我来架构12306网站 .

序言&#xff1a; 此文的撰写始于国庆期间&#xff0c;当中由于工作过于繁忙而不断终止撰写&#xff0c;最近在设计另一个电商平台时再次萌发了完善此文并且发布此文的想法&#xff0c;期望自己的绵薄之力能够给予各位同行一些火花&#xff0c;共同推进国内的大型在线交易系统…

WAP网站浏览器(模拟器)大全

除了利用WAP手机登陆WAP站点浏览WAP网站外&#xff0c;基于PC的WAP浏览器(模拟器)也越来越多&#xff0c;另外还有不少WAP在线浏览器。希望您在下面的WAP浏览器中找到一款适合自己的浏览器。 1.Openwave V7 Simulator 2.M3Gate V1.2 3.WinWap3.1 PRO 4.Wapdisplayer V1.5 5.W…

WAP网站源代码--WAP新闻(文章)系统调试实战zz

WAP网站源代码--WAP新闻(文章)系统调试实战 WAP新闻(文章)系统效果预览图1.首先&#xff0c;我们登陆中国被爱可以在线下载QuickWAP V1.5和WAP新闻(文章)系统(QuickWAP V1.5)&#xff0c;您除了可以在官方网站下载QuickWAP V1.5外还可以登陆以下站点下载。  天空软件站 新浪下…