`
peryt
  • 浏览: 54387 次
  • 来自: ...
最近访客 更多访客>>
社区版块
存档分类
最新评论
  • waiting: 既然都指定了dataType为'script'那就不必特别在b ...
    jQuery

add css

css 
阅读更多

1. the images need to go to public/images dir.

 

2. the comments in css file:

/* ...............*/

 

3. see the example css below, we will explain one by one:

 

.container {
  width: 710px;
}

body {
  background: #cff;
}

header {
  padding-top: 20px;
}

header img {
  padding: 1em;
  background: #fff;
}

section {
  margin-top: 1em;
  font-size: 120%;
  padding: 20px;
  background: #fff;
}

section h1 {
  font-size: 200%;
}

/* Links */

a {
  color: #09c;
  text-decoration: none;
}

a:hover {
  color: #069;
  text-decoration: underline;
}

a:visited {
  color: #069;
}

 

Each rule refers to a class, an id, an html tag, or some combination, followed by a list of styling commands.

 

 

body {
  background: #cff;
}

 this rule will change the background color of the body tag to baby blue.

(#cff stand for a color.)

 

note: html color can be coded with 3 hexadicimal numbers, 1st number for red, 2nd number for green, 3rd number for blue.

#fff is pure white.

#000 is pure black.

 

 

header img {
  padding: 1em
  background: #fff;
}

 this rule puts a padding layer of 1 em (roughly the width of the letter M) around the img inside a header tag.

it also make the backgroud #fff, which is white.

 

 

.container {
  width: 710px;
}
 

this rule styles an element with class "container", in this case, the width is 710 pixels.(that is 18 blueprint columns).

you must noticed the "." before container.

the dot in ".container" indicates that the rule styles a class called "container"

 

While, the pound sign "#" indicated a rule to style a CSS id, in the same way a dot indicates a class.

 

 

4. 

nav {
  float: right;
}

nav {
  background-color: white;
  padding: 0 0.7em;
  white-space: nowrap;
}

nav ul {
  margin: 0;
  padding: 0;
}

nav ul li {
  list-style-type: none;
  display: inline-block;
  padding: 0.2em 0;
}

nav ul li a {
  padding: 0 5px;
  font-weight: bold;
}

nav ul li a:visited {
  color: #09c;
}

nav ul li a:hover {
  text-decoration: underline;
}

 here, "nav ul" styles a ul tag inside a nav tag, 

"nav ul li" styles an li tag inside a ul tag insdie a nav tag, and so on.

 

5. next we will make the link of "sign in now" better:

 

a.signup_button {
  margin-left: auto;
  margin-right: auto;
  display: block;
  text-align: center;
  width: 190px;
  color: #fff;
  background: #006400;
  font-size: 150%;
  font-weight: bold;
  padding: 20px;
}

 

6. we have used "round" class before, which function is round the corners of buttons, etc.

we will define this css now.

 

.round {
  -moz-border-radius:   10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}
 
0
0
分享到:
评论

相关推荐

    AddCSS-crx插件

    语言:English (United States) 此扩展允许您添加自己的自定义网站特定...AddCSS是一个简洁的扩展程序,使您可以将自己的自定义域特定CSS代码添加到网页中,甚至可以在不同计算机上的Chrome浏览器之间同步自定义代码。

    使用babel宏在构建时将CSS转换为ReactNative样式表

    yarn add css-to-rn.macro babel-plugin-macros ``` 接下来,你需要配置Babel以使用这个宏。在你的`.babelrc`或`babel.config.js`文件中添加以下内容: ```json { "plugins": ["macros"] } ``` 现在,你可以在你...

    Delighters添加CSS动画以在用户向下滚动时取悦用户

    element.classList.add('is-visible'); } }); ``` 这段代码会在元素进入视窗时添加`is-visible`类,然后在CSS中定义这个类来启动动画: ```css .delighter.is-visible { animation-play-state: running; } ``` ...

    css-pro-layout:CSS库,用于构建响应式和可自定义的布局

    yarn add css-pro-layout 将css-pro-layout.css导入模块 import 'css-pro-layout/dist/css/css-pro-layout.css' ; CDN 您也可以使用的CDN链接 < link href =" ...

    webpack的CSS加载器的使用

    **Webpack中的CSS加载器使用详解** 在Web开发中,Webpack是一个强大的模块打包工具,它能够处理各种类型的资源,包括CSS。CSS加载器是Webpack中的一部分,它们负责转换和处理CSS文件,使其能够在JavaScript环境中...

    css-vars:Sass mixin与Sass一起使用CSS自定义属性

    css-vars:将CSS自定义属性与Sass一起使用安装使用npm: npm install css-vars 与纱线: yarn add css-vars 使用Bower: bower install css-var 手动:获取使用@import语句在项目中包含主mixin文件: @import " [%...

    css-generator-plugin:根据class 自动生成css文件

    css-generator-plugin 自动生成css文件,高效开发页面更新记录2.1.5bugFix: ellipsis 属性移除了 display: inline-block 生成如何使用安装依赖 npm install css-generator-plugin -D yarn add css-generator-plugin ...

    css-to-rn:将CSS字符串转换为React Native

    yarn add css-to-rn 该软件包取决于react-native因此请确保已安装它。 用法 import React from 'react' ; import { Text , View } from 'react-native' ; import cssToRn from 'css-to-rn' ; const styles = ...

    css framework 漂亮的CSS

    Add the following four links to the <head> of your page:: <link rel="stylesheet" href="../css/screen.css" type="text/css" media="screen, projection"> <link rel="stylesheet" href="../css/print.css" ...

    Web开发平台Ophal.zip

    Ophal 是一个可高度伸缩的 Web 平台,旨在简化维护、学习和扩展... jQuery and CSS whenever you need them (using functions addjs() and addcss()) Built-in sandboxed theme engine 标签:Ophal Web框架

    CSS重置

    yarn add css-reset 手动安装 首先,让我们克隆此存储库: git clone https://github.com/mlaurel/css-reset.git 然后,转到css-reset目录: cd css-reset 现在,您可以运行以下命令来缩小主重置并将其移动到...

    magento的常用设置实用.pdf

    <action method="addCss"><stylesheet>css/styles.css</stylesheet></action> <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action> ...

    css-patch:CSS补丁生成器。 简而言之

    CSS补丁 生成CSS补丁(就像diff一样)。使用理由主题生成制作新主题的最简单方法是复制文件并更改一些内容,或者如果使用预处理器(例如SCSS,Less等),则...安装通过纱线安装: yarn add css-patch通过npm安装: np

    用法javascript插入样式_.docx

    function addCSS(cssText) { var style = document.createElement('style'); var head = document.head || document.getElementsByTagName('head')[0]; style.type = 'text/css'; if (style.styleSheet) { // ...

    HTML5&CSS3智能感知架构 for Viual Studio 2010

    让Visual Studio 2010可以支持HTML5和CSS3,实测安装SP1后再安装没问题,如果不安装SP1,应该也能支持,但是没有...HTML 5 Intellisense Schema,Power CSS3 Intellisense Schema,Add CSS 3 to Visual Studio 2010。

    使用Mootools动态添加Css样式表代码,兼容各浏览器

    下面的代码展示了一个名为`AddCss`的函数,这个函数能够根据传入的CSS文本内容,在当前页面中动态添加样式规则,同时兼容各种主流浏览器,包括Internet Explorer(从6到9)和Firefox。 ```javascript AddCss = ...

    Python库 | pelican-add-css-classes-1.0.4.tar.gz

    标题中的"pelican-add-css-classes-1.0.4.tar.gz"是一个Python库的压缩包,用于增强Pelican这个静态站点生成器的功能。Pelican是一个流行的开源工具,它使用Markdown或ReStructuredText等标记语言来创建静态网站,...

    css-camera:使用CSS3 3D变换查看网页的新方法

    :gear_selector: 安装npm i css-camera# oryarn add css-camera :person_running: 快速开始// Prerequisite:// Create your scene as you likeconst card = document . querySelector ( "#card" ) ;const ...

Global site tag (gtag.js) - Google Analytics