当前位置: 首页 > news >正文

做网彩网站公司网站推广怎么做

做网彩网站,公司网站推广怎么做,教育平台网站开发,网站 备案 初审1.直接引入css文件 import "./parent.css" 2.引入css模块,定义文件名[组件名.module.css];该方式可避免类名的重复,每个组件都有独立的作用域,避免了全局污染,保证了类名的唯一性 import styles from &qu…

1.直接引入css文件

import "./parent.css"

2.引入css模块,定义文件名[组件名.module.css];该方式可避免类名的重复,每个组件都有独立的作用域,避免了全局污染,保证了类名的唯一性

import styles from "./parent1.module.css"
.title{color: red;
}
<h2 className={styles.title} style={{ background:'pink' }}>我是父组件</h2>

3.第三方依赖库styled-components,需要下载第三方依赖库,定义每个组件的样式 

 下载依赖库指令:npm install styled-components -S

import styleComponents from "styled-components"// 自定义样式的组件 注意定义的首字母大写,不然不生效
const StyleP = styleComponents.p`color: green;font-size: 30px;font-weight: bolder;
`
const StyleTitle = styleComponents.h1`color: red
`
<StyleTitle>第三方库引入css demo</StyleTitle>
<StyleP>第三方库引入css demo</StyleP>

4.应用 

(1)传参;在组件标签上绑定参数,通过箭头函数获取并操作参数

const Wrapper = styled.div`width: ${props => props.wrapperWidth};height: ${({wrapperHeight}) =>parseInt(wrapperHeight)/2 + 'px'};background: red;
`
<Wrapper wrapperWidth="200px" wrapperHeight="100px"></Wrapper>

(2)继承;通话styled来继承父组件的样式属性

const ParentItem = styled.div`display: block;color: yellow;text-align: center;line-height: 1.5;font-size: 20px;
`
const Item = styled(ParentItem)`color: blue;font-size: 16px;&:nth-child(2n-1){background: #00ffe4;}
`
<ParentItem style={{color: 'red'}}>姜虎东</ParentItem>
<Item>都到曦</Item>
<Item style={{color: '#fff'}}>郑九元</Item>

(3)操作styled组件的样式属性;可在组件标签上定义属性、也可以通过attrs定义属性

const UserInput = styled.input`display: block;width: 500px;
`
// 通过attr定义属性
const PasswordInput = styled.input.attrs(({ type, placeholder }) => ({ type: type ? type : 'text',placeholder: placeholder || '请输入'}))`display: block;
`
用户名:<UserInput value={this.state.username} type="text" placeholder="请输入用户名"></UserInput>
用户:<PasswordInput value={this.state.username}></PasswordInput>
{/* 在组件标签上定义属性 */}
密码:<PasswordInput value={this.state.password} type="password" placeholder="请输入密码"></PasswordInput>

http://www.mmbaike.com/news/99233.html

相关文章:

  • 制作公司网站要多少钱搜索引擎优化培训班
  • 书画院网站建设方案域名停靠网页app推广大全
  • 网站建设服务怎么样爱网站查询挖掘工具
  • 盐田高端网站建设浙江企业seo推广
  • 做网站尺寸一般都多大谷歌google中文登录入口
  • 新闻网站规划建设整合营销传播的定义
  • 南京文化云网站建设中国大数据平台官网
  • 珍岛做网站怎么样重庆搜索排名提升
  • 网站设计培训课程重庆快速排名优化
  • 学院管理网站建设建立网站的步骤
  • 上海网站建设基础网络销售平台上市公司有哪些
  • 宜昌做网站的百度公司招聘条件
  • 支付网站建设费用做账seo学徒招聘
  • 凤岗东莞微信网站建设百度关键词点击工具
  • 深圳网站建设公司是梅州seo
  • 天水建设局网站渣土治理百度一下网页打开
  • wordpress获取自定义文章分类名网站seo哪里做的好
  • 专门做护肤品网站免费com域名注册网站
  • 桂林市网站设计零基础seo入门教学
  • 如何优化网站 提高排名营销培训课程ppt
  • 记事本做网站背景色怎么弄网络营销是什么专业类别
  • 怎么做网站相册东莞建设企业网站公司
  • 计算机毕业设计代做网站seo查询爱站网
  • 建设厅网站上传不了身份证全球十大搜索引擎排名及网址
  • 网站建设近义词湖北网站设计
  • wordpress获取图片原图搜索引擎营销就是seo
  • 网站设计制作 联系查询域名注册信息
  • 网站开发做什么的北京网络排名优化
  • 有空间与域名后怎么做网站创意营销策划方案
  • 两个域名同一个网站做优化数据分析一般用什么软件