界面设计【1】-项目的UI设计css

引言:

本篇博客对简单的css html界面设计做了简要介绍

这篇博客主要就是介绍了做横向项目中,CSS界面设计与优化。


界面设计【1】-项目的UI设计css

1. 什么是css?

CSS是层叠样式表(Cascading Style Sheets)的缩写,是一种用于设计网页布局和外观的标记语言。具体来说,CSS有以下特点和作用:

CSS是一种样式表语言,用于描述HTML或XML(包括如SVG、XHTML等格式)文档的呈现。CSS描述了在屏幕、纸质、音频等媒介中元素应该如何被渲染的问题。

2. css编程demo

html代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles.css">
  <title>My Resume</title>
</head>
<body>
  <div class="resume">
    <div class="header">
      <h1>Andrew Kawasaki</h1>
      <p>Web Developer</p>
    </div>
    <div class="section">
      <h2>Education</h2>
      <p>Doctor's in Computer Science - XYZ University</p>
    </div>
    <div class="section">
      <h2>Experience</h2>
      <p>Doctor of Engineering</p>
      <p>Posdoctoral Researcher</p>
    </div>
    <div class="section">
      <h2>Skills</h2>
      <ul>
        <li>Fault Diagnosis</li>
        <li>Machinery Dynamic Modeling</li>
        <li>Python & Matlab</li>
      </ul>
    </div>
  </div>
</body>
</html>

css代码如下:

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.resume {
  max-width: 600px;
  margin: 20px auto;
  padding: 20px;
  border: 2px solid #333;
  border-radius: 10px;
}

.header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 2em;
}

.section {
  margin-bottom: 20px;
}

h2 {
  margin-bottom: 10px;
}

ul {
  padding-left: 20px;
}

ul li {
  list-style: square;
}

3. 可视化效果

在这里插入图片描述

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
设计 UI 界面的代码一般是使用 WXML 和 WXSS 语言编写的。WXML 是一种类似于 HTML 的标记语言,用于描述小程序的结构;WXSS 是一种类似于 CSS 的样式语言,用于描述小程序的样式。下面是一个简单的 WXML 和 WXSS 代码示例: ```WXML <!-- index.wxml --> <view class="container"> <view class="header"> <image class="logo" src="/images/logo.png"></image> <text class="title">拉钩招聘</text> </view> <view class="search"> <input class="search-input" type="text" placeholder="请输入关键词"></input> <button class="search-btn">搜索</button> </view> <view class="job-list"> <view class="job-item"> <image class="job-logo" src="/images/job1.png"></image> <view class="job-info"> <text class="job-title">Java开发工程师</text> <text class="job-salary">10-20k</text> <text class="job-company">拉钩科技</text> </view> </view> <view class="job-item"> <image class="job-logo" src="/images/job2.png"></image> <view class="job-info"> <text class="job-title">前端开发工程师</text> <text class="job-salary">8-15k</text> <text class="job-company">拉钩科技</text> </view> </view> </view> </view> ``` ```WXSS /* index.wxss */ .container { display: flex; flex-direction: column; align-items: center; margin-top: 20px; } .header { display: flex; align-items: center; margin-bottom: 20px; } .logo { width: 50px; height: 50px; margin-right: 10px; } .title { font-size: 24px; color: #333; } .search { display: flex; align-items: center; margin-bottom: 20px; } .search-input { flex: 1; height: 40px; border: 1px solid #ccc; border-radius: 20px; padding: 0 20px; } .search-btn { width: 80px; height: 40px; margin-left: 10px; background-color: #3388ff; color: #fff; border-radius: 20px; border: none; } .job-list { display: flex; flex-direction: column; align-items: center; } .job-item { display: flex; align-items: center; margin-bottom: 20px; } .job-logo { width: 80px; height: 80px; margin-right: 10px; } .job-info { display: flex; flex-direction: column; } .job-title { font-size: 18px; color: #333; } .job-salary { font-size: 16px; color: #999; margin-top: 10px; } .job-company { font-size: 16px; color: #999; margin-top: 10px; } ``` 以上代码仅供参考,实际项目中可能会有更加复杂的 UI 设计和代码实现。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cnjs1994

你的鼓励将是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值