2019独角兽企业重金招聘Python工程师标准>>>
本文我们在前文基础上引入一个例子,边做边聊控制器。
我们想实现一个课程查询的功能。
首先大脑应该条件反射——如何定义MVC。
M:课程(包含章节)——Course(包含Chapter)
V:课程页面——course_overview.jsp
C:编写一个控制器接收springMVC前端控制器dispatcherServlet的请求转发——CourseController
另外,Service——一些业务逻辑调用——业务接口CourseService,业务实现CourseServiceImpl
然后,在思考如何在springMVC下组织上述各个部分。
C控制器是M、V、Service的中间桥梁,如何组织都是围绕着C展开的。
请求URL由springMVC前端控制器dispatcherServlet转发给控制器C——在web.xml配置dispatcherServlet,给出前端控制器配置文件路径
如何标记控制器C——配置前端控制器配置文件,定义搜索包范围空间、激活注解;在类定义的地方为类添加控制器注解
如何将URL请求与控制器之间建立映射——RequestMapping注解控制器类和方法
控制器C调用Service业务逻辑——在控制器类相应方法中调用Service接口方法;Service被控制器C所关联,控制器C中的Service属性引用需要用spring的依赖注入的方式完成初始化,所以要配置spring容器(一是要在web.xml配置spring,指明spring容器配置文件路径;二是在spring容器配置文件中配置好这些bean,本文的示例采用注解方法)
控制器C与视图V建立映射——前端控制器配置文件配置ViewResolver(定义前缀和后缀);控制器类的对应的接收请求的方法返回字符串;拼接出webapp下的资源路径字符串。
以上我通过两两关系描述了几部分是如何组织起来的,各种配置分别解决哪一个两两关系。好,我们直接进入项目来看。
首先是定义M、V、C、Service几个部分:
M部分:
Course:
package com.happyBKs.model;
import java.util.List;
public class Course {
// 课程Id
private Integer courseId;
// 课程名称
private String title;
// 图片路径
private String imgPath;
// 学习人数
private Integer learningNum;
// 课程时长
private Long duration;
// 课程难度
private Integer level;
// 课程难度描述
private String levelDesc;
// 课程介绍
private String descr;
// 课程提纲
private List chapterList;
public Integer getCourseId() {
return courseId;
}
public void setCourseId(Integer courseId) {
this.courseId = courseId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getLearningNum() {
return learningNum;
}
public void setLearningNum(Integer learningNum) {
this.learningNum = learningNum;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public String getImgPath() {
return imgPath;
}
public void setImgPath(String imgPath) {
this.imgPath = imgPath;
}
public List getChapterList() {
return chapterList;
}
public void setChapterList(List chapterList) {
this.chapterList = chapterList;
}
public Long getDuration() {
return duration;
}
public void setDuration(Long duration) {
this.duration = duration;
}
public String getDescr() {
return descr;
}
public void setDescr(String descr) {
this.descr = descr;
}
public String getLevelDesc() {
return levelDesc;
}
public void setLevelDesc(String levelDesc) {
this.levelDesc = levelDesc;
}
}
Chapter:
package com.happyBKs.model;
public class Chapter {
private Integer id;
private Integer courseId;
private Integer order;
private String title;
private String descr;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCourseId() {
return courseId;
}
public void setCourseId(Integer courseId) {
this.courseId = courseId;
}
public Integer getOrder() {
return order;
}
public void setOrder(Integer order) {
this.order = order;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescr() {
return descr;
}
public void setDescr(String descr) {
this.descr = descr;
}
}
V:
\src\main\webapp\WEB-INF\jsps\course_overview.jsp
<%@ page language="java"
contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
HappyBKs喜欢原先的osc博客页面
${course.title}
- 学习人数 ${course.learningNum }
- 课程时长 ${course.duration }秒
- 课程难度 ${course.levelDesc }
值得注意的是,这里的href="<%=request.getContextPath()%>/resources/css/main.css"这里url资源路径中的resources/**会在前端控制器配置文件中被配置映射到webapp项目资源路径。
这个后面会有详细的配置文件。
另外,jsp页面中的EL表达式中course,其名称也与控制器类中的相关参数和配置相对应。
Service:
业务模块部分都是讲接口调用和业务实现分类的。一个接口对应一个实现。
CourseService
package com.happyBKs.service;
import com.happyBKs.model.Course;
import org.springframework.stereotype.Service;
@Service
public interface CourseService {
Course getCoursebyId(Integer courseId);
}
CourseServiceImpl
package com.happyBKs.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.happyBKs.model.Chapter;
import com.happyBKs.model.Course;
import com.happyBKs.service.CourseService;
import org.springframework.stereotype.Service;
@Service("courseService")
public class CourseServiceImpl implements CourseService {
public Course getCoursebyId(Integer courseId) {
Course course = new Course();
course.setCourseId(courseId);
course.setTitle("springMVC笔记系列");
course.setImgPath("resources/imgs/course-img.jpg");
course.setLearningNum(12345);
course.setLevel(2);
course.setLevelDesc("中级");
course.setDuration(7200l);
course.setDescr("springMVC哈哈哈哈。");
List chapterList = new ArrayList();
warpChapterList(courseId,chapterList);
course.setChapterList(chapterList);
return course;
}
private void warpChapterList(Integer courseId,List chapterList) {
Chapter chapter = new Chapter();
chapter.setId(1);
chapter.setCourseId(courseId);
chapter.setOrder(1);
chapter.setTitle("第1章 什么springMVC");
chapter.setDescr("此处略去1个字");
chapterList.add(chapter);
chapter = new Chapter();
chapter.setId(2);
chapter.setCourseId(courseId);
chapter.setOrder(2);
chapter.setTitle("第2章 环境搭建");
chapter.setDescr("此处略去2个字");
chapterList.add(chapter);
chapter = new Chapter();
chapter.setId(3);
chapter.setCourseId(courseId);
chapter.setOrder(3);
chapter.setTitle("第3章 前端控制器");
chapter.setDescr("此处略去3个字");
chapterList.add(chapter);
chapter = new Chapter();
chapter.setId(4);
chapter.setCourseId(courseId);
chapter.setOrder(4);
chapter.setTitle("第4章 spring上下文环境配置");
chapter.setDescr("此处略去4个字");
chapterList.add(chapter);
chapter = new Chapter();
chapter.setId(5);
chapter.setCourseId(courseId);
chapter.setOrder(5);
chapter.setTitle("第5章 示例");
chapter.setDescr("此处略去5个字");
chapterList.add(chapter);
}
}
控制器C:
好好好,终归到了几个部分的中心环节了。CourseController类是控制器类,用@Controller注解。其类和方法注解@RequestMapping,实现请求url到控制器类的映射。当然控制器类的相应方法会返回相关字符串,与前端控制器配置文件\WEB-INF\configs\spring\mvc-dispatcher-servlet.xml中的项目视图资源映射,即这里映射到\WEB-INF\jsps\course_overview.jsp
CourseController
package com.happyBKs.controller;
import com.happyBKs.model.Course;
import com.happyBKs.service.CourseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/**
* Created by happyBKs on 2016/6/15.
*/
@Controller
@RequestMapping("/courses")
// /courses/**
public class CourseController {
//完成日志信息
private static Logger log= LoggerFactory.getLogger(CourseController.class);
private CourseService courseService;
//使用spring容器管理里了对应的依赖关系
@Autowired
public void setCourseService(CourseService courseService) {
this.courseService = courseService;
}
//提供完成一个业务的方法:根据课程ID查询课程内容。
//本方法将处理 /courses/view?courseId=123 形式的URL
@RequestMapping(value="/view", method= RequestMethod.GET)
public String viewCourse(@RequestParam("courseId") Integer courseId,
Model model) {
//日志输出,查看请求的courseId是不是我们的courseId
log.debug("In viewCourse, courseId = {}", courseId);
Course course = courseService.getCoursebyId(courseId);
model.addAttribute(course);
return "course_overview";
}
}
在这个控制器类中,我们注入了一个Service。Service和控制器C之间存在依赖,我们使用spring依赖注入Service的实现类对象,使用的自动化注入成员变量引用某个具体的bean,用@Autowired注解,相应的被注解的业务实现类需要标注@Service,并且,spring配置文件的搜索包空间必须包含它。
另外,本控制器类中增加了一个日志工具,帮助我们记录下执行步骤和信息。因为需要用slf4j中的log相关类型。所以我们需要重新对pom.xml增加一些jar的依赖坐标。
pom.xml
4.0.0
testIdea.happBKs.mvc
springMVC
war
1.0-SNAPSHOT
springMVC Maven Webapp
http://maven.apache.org
2.6
1.7.21
4.2.6.RELEASE
2.7.4
org.springframework
spring-framework-bom
${spring.version}
pom
import
junit
junit
4.10
test
org.springframework
spring-webmvc
commons-lang
commons-lang
${commons-lang.version}
org.slf4j
slf4j-log4j12
${slf4j.version}
slf4j-api
org.slf4j
org.slf4j
slf4j-api
${slf4j.version}
javax.servlet
servlet-api
2.5
com.fasterxml.jackson.core
jackson-databind
${jackson.version}
jstl
jstl
1.2
springMVC
还需要一log的配置文件:
注意,这个配置文件属于源代码的配置文件,与webapp的配置文件不同,所以这里所处的resouces文件夹其实不同的一个,特别注意!!
log4j.appender.Cons=org.apache.log4j.ConsoleAppender
log4j.appender.Cons.layout=org.apache.log4j.PatternLayout
log4j.appender.Cons.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
# Root logger set to DEBUG using the A2 appender defined above.
log4j.rootLogger=info, Cons
log4j.additivity=false
#Application Logger+
log4j.logger.com.imooc.mvcdemo=debug, Cons
log4j.logger.org.springframework=debug, Cons
log4j.additivity.com=false
springMVC的配置文件\WEB-INF\configs\spring\mvc-dispatcher-servlet.xml
spring容器配置文件applicationContext.xml:
另外需要一些css文件和js文件,这个不细说。
@charset "UTF-8";
/* CSS reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{ margin: 0; padding: 0; }
fieldset,img{ border: 0; }
:focus{ outline: 0; }
address,caption,cite,code,dfn,em,strong,th,var,optgroup{ font-style: normal; font-weight: normal; }
h1,h2,h3,h4,h5,h6{ font-size: 100%; font-weight: normal; font-family: "Microsoft YaHei"; }
abbr,acronym{ border: 0; font-variant: normal; }
code,kbd,samp,tt{ font-size: 100%; }
input,button,textarea,select{ *font-size: 100%; border:none;}
body{ background:#fff; color:#5e5e5e; font: 14px/2em Microsoft YaHei,SimSun,Arial;}
ol,ul{ list-style: none; }
table{ border-collapse: collapse; border-spacing: 0; }
caption,th{ text-align: left; }
sup,sub{ font-size: 100%; vertical-align: baseline; }
:link, :visited, ins{ text-decoration: none; }
blockquote,q{ quotes: none; }
blockquote:before, blockquote:after, q:before, q:after{ content: ''; content: none; }
a:link, a:visited{ color: #5e5e5e;}
a:hover { color:#c9394a;}
a:active { color: #666;}
.clearfix:after{content:'\0020';display:block;height:0;clear:both;visibility:hidden;}
.clearfix{*zoom:1;}
.l{float:left;}
.r{float:right;}
.clear{ height:0; overflow:hidden; clear:both}
.hide{display:none;}
.btn.hide{display:none;}
a.hidefocus { outline: none; }
button.hidefocus::-moz-focus-inner { border:none; }
a:focus {outline:none;-moz-outline:none;}
input,textarea {outline:none;}
h2 { font-size: 20px; }
h3 { font-size: 16px; line-height: 32px; }
h5 { font-size: 14px; line-height: 28px; }
/*border && padding*/
.img_border { border: 4px solid #fff; border-radius: 1px;}
.bb { border-bottom: 1px solid #d2d2d2 }
.bt { border-top: 1px solid #d2d2d2 }
.pt15 { padding-top: 15px; }
.pb15 { padding-bottom: 15px; }
.p15{ padding:0 15px}
/*颜色定义*/
.color-gray,a.color-gray:link,a.color-gray:visited{color:#b7bcc0;}html,
body {
font: 14px/1.5 "Microsoft Yahei", "Hiragino Sans GB", Helvetica, "Helvetica Neue", "微软雅黑", Tahoma, Arial, sans-serif;
color: #14191e;
}
body {
overflow-y: scroll;
}
body {
background-color: #edeff0;
}
a:link,
a:visited {
color: #14191e;
}
a:hover,
a:active {
color: #cc0000;
}
.clearfix:after {
content: '\0020';
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {
*zoom: 1;
}
.l {
float: left;
}
.r {
float: right;
}
.hide {
display: none;
}
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
.newcontainer,
.page-container {
margin: 0 auto;
width: 1200px;
}
.container {
margin: 0 auto;
}
.container {
width: 1200px;
}
#main {
min-height: 750px;
padding: 20px 0;
}
.waper {
width: 1200px;
margin: 0 auto;
}
.shadow {
-webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.text-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#header {
background: #000000;
}
#nav {
height: 60px;
margin: 0 auto;
position: relative;
z-index: 1000;
}
.logo {
float: left;
}
#logo a,
.logo a {
display: block;
height: 60px;
width: 140px;
background: url(/static/img/common/logo.png) no-repeat center center;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
.logo a {
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.logo a:hover {
background-color: #363c41;
}
.nav-item li {
float: left;
width: 100px;
}
.nav-item a {
display: block;
color: #787d82;
text-align: center;
font-size: 14px;
height: 60px;
line-height: 60px;
-webkit-transition: background-color 0.3s;
-moz-transition: background-color 0.3s;
transition: background-color 0.3s;
}
.nav-item a:hover {
color: #fff;
background-color: #363c41;
}
/*.nav-item-mycourse a {
width: 120px;
}*/
/*全局搜索*/
.search-area {
float: right;
position: relative;
height: 30px;
width: 240px;
margin: 15px 0;
margin-right: 20px;
background: #363c41;
}
.search-area .search-input {
padding: 5px 10px;
width: 190px;
height: 20px;
line-height: 20px;
font-size: 12px;
float: left;
border: 0;
background: #363c41;
color: #14191e;
-webkit-transition: background-color 0.3s;
-moz-transition: background-color 0.3s;
transition: background-color 0.3s;
}
.search-area .search-input:-moz-placeholder {
color: #787d82;
}
.search-area .search-input::-moz-placeholder {
color: #787d82;
opacity: 1;
}
.search-area .search-input:-ms-input-placeholder {
color: #787d82;
}
.search-area .search-input::-webkit-input-placeholder {
color: #787d82;
}
.search-area .search-input.placeholder {
color: #787d82;
}
.search-area .btn_search {
float: right;
cursor: pointer;
width: 30px;
height: 30px;
-webkit-transition: background-color 0.3s;
-moz-transition: background-color 0.3s;
transition: background-color 0.3s;
}
.search-area .btn_search,
.search-area .course,
.search-area .wenda {
background: url(/static/img/gsearch-sprite.png) no-repeat 0 0;
}
.search-area.focus .search-input {
color: #363d40;
background: #fff;
}
.search-area.focus .btn_search {
background-position: 0 -40px;
background-color: #fff;
}
.search-area .search-area-result {
position: absolute;
left: 0px;
top: 31px;
width: 258px;
margin-bottom: 20px;
border: 1px solid #d3d3d3;
border-top: none;
background-color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
font-size: 12px;
overflow: hidden;
display: none;
z-index: 1000;
}
.search-area .search-area-result dt,
.search-area .search-area-result dd {
height: 40px;
line-height: 40px;
}
.search-area .search-area-result dt {
padding: 0 10px;
color: #787d82;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.search-area .search-area-result dt span {
color: #14191e;
}
.search-area .search-area-result dd a {
padding: 0 10px 0 33px;
display: block;
width: auto;
color: #787d82;
}
.search-area .search-area-result dd span {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.search-area .search-area-result dd a:hover,
.search-area .search-area-result .curr a {
color: #14191e;
background-color: #edf0f2;
}
.search-area .course {
background-position: 10px -80px;
}
.search-area .search-area-result .curr .course {
background-position: 10px -130px;
}
.search-area .wenda {
background-position: 10px -180px;
}
.search-area .search-area-result .curr .wenda {
background-position: 10px -230px;
}
#login-area {
float: right;
position: relative;
}
.header-unlogin li {
float: left;
}
.header-signin a,
.header-signup a {
display: block;
width: 60px;
font-size: 14px;
text-align: center;
height: 60px;
line-height: 60px;
color: #787d82;
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.header-signin a:hover {
color: #fff;
background-color: #cc0000;
}
.header-signup a:hover {
color: #fff;
background-color: #363c41;
}
.logined > li {
float: left;
}
.logined li > a {
display: block;
height: 60px;
line-height: 60px;
width: 60px;
color: #787d82;
text-align: center;
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.logined li > a:hover {
color: #fff;
background-color: #363c41;
}
.my_message a {
background: url(/static/img/icon_msg.png) no-repeat center center;
}
.my_message a span {
display: none;
}
.msg_icon {
display: none;
position: absolute;
padding: 0px 4px;
height: 16px;
left: 32px;
top: 10px;
line-height: 14px;
background: #c9394a;
color: #fff;
font-style: normal;
font-size: 10px;
}
.my_mp span {
display: block;
line-height: 16px;
color: #6c7072;
}
.my_mp .mp {
padding-top: 12px;
font-size: 12px;
}
.my_mp a:hover .mp_num {
color: #fff;
}
.set_btn {
right: 0px;
cursor: pointer;
}
.set_btn a.hover {
background-color: #363d40;
}
.set_btn img {
border-radius: 22px;
border: 2px solid #adb0b1;
vertical-align: middle;
display: inline-block;
background: url(/static/img/menu_icon.png) no-repeat 0 0;
}
#nav_list {
display: none;
z-index: 999;
width: 140px;
position: absolute;
top: 60px;
right: 0px;
background: #363c41;
list-style: none;
}
#nav_list li a {
border-top: 1px solid #4a5153;
height: 39px;
line-height: 39px;
font-size: 14px;
background-image: url(/static/img/menu_icon.png?t=10);
background-repeat: no-repeat;
display: block;
color: #fff;
text-align: left;
padding: 0;
padding-left: 47px;
width: auto;
}
#nav_list a:hover {
color: #fff;
background-color: #4d5559;
}
#nav_list #my_space {
padding: 0 18px;
background-image: none;
border: 0;
height: 49px;
line-height: 49px;
text-align: center;
}
#nav_list .my_message {
background-position: 19px -46px;
}
#nav_list #my_note {
background-position: 19px -90px;
}
#nav_list #my_question {
background-position: 19px -128px;
}
#nav_list #my_setting {
background-position: 19px -167px;
}
#nav_list #my_logout {
background-position: 19px -207px;
}
.myspace_remind {
width: 10px;
height: 10px;
background: url(/static/img/space-remind.png) no-repeat 0 0;
position: absolute;
top: 10px;
right: 10px;
}
/*footer*/
#footer {
background: #000000;
border-top: 1px solid #e2e4e6;
font-size: 12px;
color: #787d82;
padding: 40px 0;
min-width: 1200px;
}
#footer .footer_intro {
border-right: 1px solid #363c41;
width: 639px;
}
#footer p {
margin-left: 180px;
line-height: 1.7;
}
.footer_logo {
float: left;
background: url(/static/img/common/footer-sprite.png) 0 -230px no-repeat;
height: 40px;
width: 120px;
margin: 0 20px;
}
#footer .des {
width: 445px;
}
#footer .followus {
padding-left: 30px;
}
.followus a {
float: left;
position: relative;
width: 32px;
height: 32px;
background-image: url(/static/img/common/footer-sprite.png);
background-repeat: no-repeat;
margin: 3px 6px 0;
opacity: 0.5;
filter: alpha(opacity=50);
-webkit-transition: opacity 0.2s;
-moz-transition: opacity 0.2s;
transition: opacity 0.2s;
}
#footer .followus a:hover {
opacity: 1;
filter: alpha(opacity=100);
}
.flw-weixin-box {
position: absolute;
display: none;
width: 170px;
height: 220px;
left: -69px;
bottom: 35px;
background: url(/static/img/common/footer-sprite.png?1) no-repeat 0 0;
}
.followus .followus-weixin {
background-position: 0 -279px;
}
.followus-weixin:hover .flw-weixin-box {
display: block;
}
.followus .followus-weibo {
background-position: 0 -321px;
}
.followus .followus-qzone {
background-position: 0 -363px;
}
.friend-links {
/*padding-top: 20px ;border-top:1px solid #4F5153;*/
line-height: 60px;
}
.friend-links a {
display: inline-block;
margin-right: 20px;
}
.friend-links a:hover {
text-decoration: underline;
color: #000;
}
.friend-links dl {
padding: 0 10px;
}
.friend-links dd {
float: left;
width: 160px;
}
#footer .footer_intro,
#footer .footer_link,
#footer .followus {
float: left;
height: 40px;
}
.footer_link ul {
overflow: hidden;
margin-top: -1px;
}
.footer_link a:link,
.footer_link a:visited,
.footer_link a:active {
color: #787d82;
}
.footer_link a:hover {
color: #fff;
}
#footer .footer_link {
padding: 0 30px;
width: 320px;
border-right: 1px solid #363c41;
line-height: 1.8;
}
#footer .footer_link li {
width: 80px;
text-align: center;
float: left;
}
/*翻页*/
.page {
margin: 25px 0 auto;
overflow: hidden;
clear: both;
text-align: center;
}
.page-inner {
padding: 0 20px;
}
.page a {
display: inline-block;
margin: 0 5px;
padding: 0 5px;
min-width: 20px;
height: 29px;
line-height: 30px;
font-size: 14px;
color: #787d82;
text-align: center;
border-bottom: 1px solid transparent;
-webkit-transition: border-color 0.2s;
-moz-transition: border-color 0.2s;
transition: border-color 0.2s;
}
.page a:hover {
border-color: #cc0000;
color: #cc0000;
text-decoration: none;
}
.page a.active {
background: #cc0000;
color: #ffffff;
border-color: transparent;
}
.page span,
.page-disabled {
display: inline-block;
padding: 0 5px;
min-width: 20px;
height: 39px;
line-height: 39px;
font-size: 14px;
color: #c8cdd2;
text-align: center;
}
.page-first,
.page-last {
width: 50px;
}
.page-prev,
.page-next {
width: 70px;
}
.page .notmargin {
margin-right: 0;
}
/*
HTML structure:
Panel title
Panel content
Panel footer
panel-heading, panel-body, panel-footer all could be select use not necessary */ .bordered { border-bottom: solid 1px #d0d6d9; } .panel { -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); padding: 0 20px; color: #14191e; background-color: #ffffff; margin-bottom: 20px; } .panel-heading { border-bottom: solid 1px #d0d6d9; } .panel-title { height: 50px; line-height: 50px; font-size: 16px; } select { margin: 0; font-size: 100%; cursor: pointer; font-weight: normal; background-color: #fff; border: 1px solid #ccc; color: #555; display: inline-block; font-size: 14px; height: 30px; line-height: 30px; padding: 4px 6px; vertical-align: middle; } select:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } /*收藏*/ a.btn-add-collection { display: block; background: url(/static/img/course/new_add_collection.png) no-repeat 46px top; height: 32px; color: #909b9e; text-align: center; line-height: 35px; } a.btn-add-collection:hover { background-position: 46px -44px; color: #fff; } a.btn-remove-collection { background-position: 46px -88px; color: #909b9e; } a.btn-remove-collection:hover { background-position: 46px -130px; } .course-title .btn-add-collection { margin-top: 6px; } .videohead .btn-add-collection { margin-top: 20px; } .js-btn-collection .concerned-icon { margin-top: 34px; display: inline-block; } /*进度条*/ progress { display: inline-block; background: #f0f0f0; border: 0; height: 6px; color: #aad94a; /*IE10 #c9394a*/ width: 400px; } progress::-webkit-progress-bar { background: #f0f0f0; } progress::-moz-progress-bar { background: #aad94a; } progress::-webkit-progress-value { background: #aad94a; } .progress { background: #f0f0f0; height: 6px; width: 400px; display: inline-block; } .progressBar { background: #aad94a; height: 6px; } .teacher-icon { width: 7px; margin-left: 5px; position: relative; top: 1px; } /*回到顶部*/ .elevator { position: fixed; right: 15px; bottom: 10px; z-index: 1030; } .elevator a { display: block; position: relative; margin: 1px 0; outline: none; height: 52px; width: 52px; -webkit-transition: background-position 0.15s; -moz-transition: background-position 0.15s; transition: background-position 0.15s; background: url(/static/img/common/elevator.png?1) no-repeat; } .elevator .elevator-diaocha { background-position: 0 -798px; } .elevator .elevator-diaocha:hover { background-position: 0 -984px; } .elevator .elevator-app-box { position: absolute; display: none; width: 172px; height: 194px; bottom: -10px; right: 46px; -webkit-transition: opacity 0.25s; -moz-transition: opacity 0.25s; transition: opacity 0.25s; opacity: 0; filter: alpha(opacity=0); background: url(/static/img/common/elevator.png) no-repeat 0 -222px; } .elevator .elevator-app { background-position: 0 -550px; } .elevator .elevator-app:hover { background-position: 0 -612px; } .elevator .elevator-app:hover .elevator-app-box { display: block; opacity: 1; filter: alpha(opacity=100); } .elevator .elevator-weixin-box { position: absolute; display: none; width: 172px; height: 212px; bottom: -10px; right: 46px; -webkit-transition: opacity 0.25s; -moz-transition: opacity 0.25s; transition: opacity 0.25s; opacity: 0; filter: alpha(opacity=0); background: url(/static/img/common/elevator.png) no-repeat 0 0; } .elevator .elevator-weixin { background-position: 0 -860px; } .elevator .elevator-weixin:hover { background-position: 0 -922px; } .elevator .elevator-weixin:hover .elevator-weixin-box { display: block; opacity: 1; filter: alpha(opacity=100); } .elevator .elevator-msg { background-position: 0 -426px; } .elevator .elevator-msg:hover { background-position: 0 -488px; } .elevator .elevator-top { background-position: 0 -674px; } .elevator .elevator-top:hover { background-position: 0 -736px; } a { outline: none; } a:active { star: expression(this.onFocus=this.blur()); } a, input, button { outline: none; } button::-moz-focus-inner { border: 0px; } input::-moz-focus-inner { border: 0px; } .autowrap { word-wrap: break-word; word-break: break-all; } .compatible-contianer { position: fixed; top: 0; left: 0; right: 0; min-width: 800px; height: 30px; line-height: 30px; background: url(/static/img/iebg.gif) repeat-x; z-index: 999999; } .cpt-ct { color: #363636; font-size: 12px; text-align: center; } .cpt-ct i { display: inline-block; width: 12px; height: 14px; vertical-align: -2px; margin-right: 5px; background: url(/static/img/iefixed-sprite.png) no-repeat 0 0; } .cpt-ct a { color: #39b94e; } .cpt-ct a:hover { text-decoration: underline; } .cpt-handle { position: absolute; right: 20px; top: 0; font-size: 12px; line-height: 27px; } .cpt-handle a { display: inline-block; vertical-align: middle; } .cpt-handle .cpt-agin { color: #656e73; margin-right: 5px; } .cpt-handle .cpt-agin:hover { color: #363d40; } .cpt-close { width: 16px; height: 16px; text-align: center; line-height: 16px; border-radius: 50%; transition: 0.3s; } .cpt-close:hover { background-color: #fc8800; } .cpt-close i { display: inline-block; height: 8px; width: 8px; vertical-align: 1px; background: url(/static/img/iefixed-sprite.png) no-repeat 0 -24px; } .cpt-close:hover i { background-position: 0 -42px; } /*用户卡片样式*/ .layer-usercard { position: absolute; z-index: 999; width: 370px; height: 165px; background: #fff; box-shadow: 0 2px 2px #999; } .layer-usercard .arrow { position: absolute; left: 65px; top: -11px; width: 19px; height: 11px; background: url(/static/img/dot_usercard.png); } .layer-usercard-header { height: 110px; background: #2a2c2e; } .layer-usercard-header .avatar img { border-radius: 50px; left: 21px; position: absolute; top: 21px; border: 3px solid #7f8082; } .layer-usercard-header dt, .layer-usercard-header dd { float: right; width: 245px; padding-right: 20px; color: #fff; } .layer-usercard-header dt { padding-top: 20px; font-size: 18px; } .layer-usercard-header dd { font-size: 12px; } .layer-usercard-info ul { overflow: hidden; padding-top: 16px; height: 32px; font-size: 16px; color: #364247; position: relative; } .layer-usercard-info li { float: left; padding: 0 22px; border-right: 1px solid #d9d9d9; } .layer-usercard-info span { color: #969b9e; font-size: 12px; } .layer-usercard-info li.noborder { border: 0; } li.layer-usercard-medal { padding: 0; top: 12px; right: 10px; width: 117px; position: absolute; border: 0; } .layer-usercard-medal a { width: 32px; height: 32px; float: left; margin-right: 5px; border-radius: 1px; overflow: hidden; } .ipt { color: #14191e; background-color: #ffffff; border: 1px solid #98a1a6; height: 20px; padding: 9px 9px; font-size: 14px; line-height: 20px; border-radius: 0; -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -moz-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; border-color: #98a1a6; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } select.ipt { height: 20px; line-height: 20px; } textarea.ipt, select[multiple].ipt { height: auto; } .ipt:-moz-placeholder { color: #c8cdd2; } .ipt::-moz-placeholder { color: #c8cdd2; opacity: 1; } .ipt:-ms-input-placeholder { color: #c8cdd2; } .ipt::-webkit-input-placeholder { color: #c8cdd2; } .ipt.placeholder { color: #c8cdd2; } .ipt:focus { border-color: #000000; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(0, 0, 0, 0.4); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(0, 0, 0, 0.4); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(0, 0, 0, 0.4); } .ipt[disabled], .ipt[readonly], .ipt.disabled { cursor: default; background-color: #edf1f2; opacity: 1; } textarea.ipt { height: auto; } .ipt-error { color: #cc0000; border-color: #cc0000; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .ipt-error:focus { border-color: #cc0000; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 0, 0, 0.4); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 0, 0, 0.4); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(204, 0, 0, 0.4); } .btn { display: inline-block; margin-bottom: 0; font-weight: 200; text-align: center; vertical-align: middle; touch-action: manipulation; cursor: pointer; text-decoration: none; box-sizing: content-box; background-image: none; border: 1px solid transparent; -webkit-appearance: none; white-space: nowrap; outline: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .btn:hover, .btn:focus, .btn.focus { color: #fff; text-decoration: none; } .btn:active, .btn.active { outline: 0; background-image: none; } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { pointer-events: none; opacity: 0.65; filter: alpha(opacity=65); box-shadow: none; } .btn-red { color: #ffffff; background-color: #cc0000; border-color: #cc0000; border-style: solid; border-width: 1px; cursor: pointer; -weibkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; width: 138px; height: 38px; line-height: 38px; font-size: 14px; } .btn-red:link, .btn-red:visited { color: #ffffff; } .btn-red:hover, .btn-red:focus, .btn-red.focus { color: #ffffff; background-color: #f00000; border-color: #f00000; } .btn-red:active, .btn-red.active { background-color: #b30000; border-color: #b30000; } .btn-red.disabled, .btn-red[disabled], .btn-red.disabled:hover, .btn-red[disabled]:hover, .btn-red.disabled:focus, .btn-red[disabled]:focus, .btn-red.disabled.focus, .btn-red[disabled].focus, .btn-red.disabled:active, .btn-red[disabled]:active, .btn-red.disabled.active, .btn-red[disabled].active { cursor: default; box-shadow: none; background-color: #cc0000; border-color: #cc0000; } .btn-blue { color: #ffffff; background-color: #0088cc; border-color: #0088cc; border-style: solid; border-width: 1px; cursor: pointer; -weibkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; width: 138px; height: 38px; line-height: 38px; font-size: 14px; } .btn-blue:link, .btn-blue:visited { color: #ffffff; } .btn-blue:hover, .btn-blue:focus, .btn-blue.focus { color: #ffffff; background-color: #00a0f0; border-color: #00a0f0; } .btn-blue:active, .btn-blue.active { background-color: #0077b3; border-color: #0077b3; } .btn-blue.disabled, .btn-blue[disabled], .btn-blue.disabled:hover, .btn-blue[disabled]:hover, .btn-blue.disabled:focus, .btn-blue[disabled]:focus, .btn-blue.disabled.focus, .btn-blue[disabled].focus, .btn-blue.disabled:active, .btn-blue[disabled]:active, .btn-blue.disabled.active, .btn-blue[disabled].active { cursor: default; box-shadow: none; background-color: #0088cc; border-color: #0088cc; } .btn-green { color: #ffffff; background-color: #00b33b; border-color: #00b33b; border-style: solid; border-width: 1px; cursor: pointer; -weibkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; width: 138px; height: 38px; line-height: 38px; font-size: 14px; } .btn-green:link, .btn-green:visited { color: #ffffff; } .btn-green:hover, .btn-green:focus, .btn-green.focus { color: #ffffff; background-color: #00d747; border-color: #00d747; } .btn-green:active, .btn-green.active { background-color: #009a33; border-color: #009a33; } .btn-green.disabled, .btn-green[disabled], .btn-green.disabled:hover, .btn-green[disabled]:hover, .btn-green.disabled:focus, .btn-green[disabled]:focus, .btn-green.disabled.focus, .btn-green[disabled].focus, .btn-green.disabled:active, .btn-green[disabled]:active, .btn-green.disabled.active, .btn-green[disabled].active { cursor: default; box-shadow: none; background-color: #00b33b; border-color: #00b33b; } .btn-normal { color: #787d82; background-color: #ffffff; border-color: #d0d6d9; border-style: solid; border-width: 1px; cursor: pointer; -weibkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; width: 138px; height: 38px; line-height: 38px; font-size: 14px; } .btn-normal:link, .btn-normal:visited { color: #787d82; } .btn-normal:hover, .btn-normal:focus, .btn-normal.focus { color: #787d82; background-color: #edf1f2; border-color: #98a1a6; } .btn-normal:active, .btn-normal.active { background-color: #f2f2f2; border-color: #c2cace; } .btn-normal.disabled, .btn-normal[disabled], .btn-normal.disabled:hover, .btn-normal[disabled]:hover, .btn-normal.disabled:focus, .btn-normal[disabled]:focus, .btn-normal.disabled.focus, .btn-normal[disabled].focus, .btn-normal.disabled:active, .btn-normal[disabled]:active, .btn-normal.disabled.active, .btn-normal[disabled].active { cursor: default; box-shadow: none; background-color: #ffffff; border-color: #d0d6d9; } .btn-sm { width: 78px; height: 28px; line-height: 28px; font-size: 12px; } /*发问题匹配问答关键词*/ .send-area-result { background: #fff; box-shadow: 0 0 8px rgba(0, 0, 0, 0.4); -moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.4); -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.4); position: absolute; top: 41px; left: 0; width: inherit; } .send-area-result dt { font-size: 12px; color: #c8cdd2; line-height: 40px; height: 40px; padding: 0 10px; } .send-area-result dd { height: 40px; line-height: 40px; } .send-area-result dd a.questiontitle { border: none; font-size: 14px; color: #787d82; width: inherit; text-align: left; height: 40px; line-height: 40px; padding: 0 10px; display: block; } .oncurr { color: #14191e; background: #edf1f2; } .send-area-result dd a.questiontitle i, .send-area-result dd a.questiontitle em { font-style: normal; font-size: 12px; margin-left: 10px; } .send-area-result dd a.questiontitle em { color: #c8cdd2; } .send-area-result dd a.questiontitle i { color: #00b33b; } @font-face { font-family: 'icomoon'; src: url('/static/fonts/icomoon.eot?w72hig'); src: url('/static/fonts/icomoon.eot?#iefixw72hig') format('embedded-opentype'), url('/static/fonts/icomoon.woff?w72hig') format('woff'), url('/static/fonts/icomoon.ttf?w72hig') format('truetype'), url('/static/fonts/icomoon.svg?w72hig#icomoon') format('svg'); font-weight: normal; font-style: normal; } [class^="icon-"], [class*=" icon-"] { font-family: 'icomoon'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-stroke-width: 0.2px; } .icon-tick:before { content: "\e600"; } .icon-home:before { content: "\e601"; } .icon-clock:before { content: "\e602"; } .icon-chat:before { content: "\e603"; } .icon-msg:before { content: "\e604"; } .icon-resp:before { content: "\e605"; } .icon-addques:before { content: "\e606"; } .icon-user:before { content: "\e607"; } .icon-wiki:before { content: "\e608"; } .icon-plan:before { content: "\e609"; } .icon-note:before { content: "\e60a"; } .icon-edit:before { content: "\e60b"; } .icon-share:before { content: "\e60c"; } .icon-set:before { content: "\e60d"; } .icon-camera:before { content: "\e60e"; } .icon-del:before { content: "\e60f"; } .icon-search:before { content: "\e610"; } .icon-key:before { content: "\e611"; } .icon-mail:before { content: "\e612"; } .icon-smail:before { content: "\e613"; } .icon-point:before { content: "\e614"; } .icon-ques:before { content: "\e615"; } .icon-tick2:before { content: "\e616"; } .icon-chapter:before { content: "\e617"; } .icon-mobile:before { content: "\e618"; } .icon-gotop:before { content: "\e619"; } .icon-statistic:before { content: "\e61a"; } .icon-code:before { content: "\e61b"; } .icon-video:before { content: "\e61c"; } .icon-test:before { content: "\e61d"; } .icon-menu:before { content: "\e61e"; } .icon-plus:before { content: "\e61f"; } .icon-sub:before { content: "\e620"; } .icon-close:before { content: "\e621"; } .icon-down:before { content: "\e622"; } .icon-left:before { content: "\e623"; } .icon-top:before { content: "\e624"; } .icon-right:before { content: "\e625"; } .icon-exit:before { content: "\e626"; } .icon-refresh:before { content: "\e627"; } .icon-again:before { content: "\e628"; } .icon-bell:before { content: "\e629"; } .icon-nobell:before { content: "\e62a"; } .icon-nolearn:before { content: "\e62b"; } .icon-half:before { content: "\e62c"; } .icon-full:before { content: "\e62d"; } .icon-point-revert:before { content: "\e62e"; } .icon-ques-revert:before { content: "\e62f"; } .icon-tick-revert:before { content: "\e630"; } .icon-flag:before { content: "\e631"; } .icon-msg-revert:before { content: "\e632"; } .icon-ad:before { content: "\e633"; } .icon-imooc:before { content: "\e634"; } .icon-thumb:before { content: "\e635"; } .icon-thumb-revert:before { content: "\e636"; } .icon-star:before { content: "\e637"; } .icon-star-revert:before { content: "\e638"; } .icon-heart:before { content: "\e639"; } .icon-heart-revert:before { content: "\e63a"; } .icon-qq:before { content: "\e63b"; } .icon-weibo:before { content: "\e63c"; } .icon-qqweibo:before { content: "\e63d"; } .icon-weixin:before { content: "\e63e"; } .icon-folder:before { content: "\e63f"; } .icon-jian:before { content: "\e640"; } .icon-ding:before { content: "\e641"; } .icon-you:before { content: "\e642"; } .icon-apple:before { content: "\e643"; } .icon-android:before { content: "\e644"; } /*course_intrduce*/ .gotoTopBtn{ margin-left: 615px; } body{ background:#EEEFF1 } .course_info { display: inline-block; height:340px; overflow:hidden; margin-top:10px; } .container h2 { height: 60px; color: #5e5e5e; font-size: 24px; clear: both; } .course-embed{ position: relative; } .video-btn:link, .video-btn:visited{ background: url(../img/course_info_sprit.png) no-repeat 25px -32px #c9394a; opacity: 0.8; filter:alpha(opacity=80); position: absolute; top: 145px; left: 35%; font-size: 24px; text-align: center; border:5px solid #fff; border-radius:30px; padding:0 30px 0 60px; height:50px; line-height:50px; color: #fff; } .video-btn:hover{ opacity:0.9; filter:alpha(opacity=90); } .course_video { width: 600px; height:340px; overflow: hidden; } #VideoCover { position: relative; } #course_front { background: url(../img/course_info_sprit.png) no-repeat 18px -29px #c9394a; opacity: 0.8; filter:alpha(opacity=80); position: absolute; top: 145px; left: 35%; color: #fff; font-size: 24px; text-align: center; border:5px solid #fff; border-radius:30px; padding:0 20px 0 50px; height:52px; line-height:52px } #course_front:hover{ opacity:0.9; filter:alpha(opacity=90); } #course_intro .video { position: relative; background: #fff; width: 600px; height: 340px; } .course_state { width:240px; float: left; background: #364247; padding:0 40px; height: 340px; overflow: hidden; } .course_state ul li { height: 113px; border-bottom: 1px solid #414f55; overflow:hidden; line-height: 113px; } .course_state ul li.mr { margin-right: 10px; } .course_state ul li span { color: #909b9e; font-size: 14px; line-height: 24px; margin-right:15px; } .course_state ul li em,.course_hour .ft-adjust span{ font-size: 24px; color: #ffffff; } .course_hour .ft-adjust{ font-size:14px; } .course_hour .ft-adjust span{ display:inline; margin:0; } .course_state ul li.course_hour { position: relative; } .course_state ul li i { padding:0 3px; background: #e5e5e5; text-align: center; color: #5e5e5e; position: absolute; right: 0; bottom: 0; font-style: normal; font-size: 16px; } .concerned_course{ background:#4d5a61; } .concerned_course em{ text-align: center; display: block; } .concerned_course .btn-add-follow { display: block; height: 100px; padding-top:40px; text-align: center; } .btn-add-follow i{ display: inline-block; background: url(/static/img/course/new_add_collection.png) no-repeat 0 0; width: 36px; height:32px; color:#909b9e; text-align: center; } .btn-add-follow em{ display: block; color: #909b9e; line-height: 1em; } .btn-add-follow:hover i{ background-position: 0 -44px } .btn-add-follow:hover em{ color: #fff; } .btn-remove-follow i{ background-position: 0 -88px; } .btn-remove-follow:hover i{ background-position: 0 -130px; } .curse_btn button.unopencourse{ background:#5e5e5e; cursor: default; } .curse_btn { clear: both; } .curse_btn button,.curse_btn a{ height:200px; width:100%; background:#c9394a; text-align:center; color:#fff; font-size:24px; line-height:200px; cursor:pointer; display:block; overflow: hidden; } .curse_btn a:hover{ background: #d65c5c; } /*边栏教师信息*/ .course_teacher { padding-top: 10px; } .course_teacher h3{ margin-top:15px; font-size: 16px; color:#333; } .course_teacher dl { float: right; padding: 5px 10px 5px 5px; width: 765px; } .course_teacher dl dt { color: #5E5E5E; font-size: 24px; line-height: 36px; } .course_teacher .teacher_icon { background: url("../img/qadetailicon.png") no-repeat scroll 0 -97px ; display:inline-block; height:16px; margin-left: 10px; width:16px; margin-top:3px } .course_teacher dl dt span.teacher_iden { background: url("../img/curse_icon.png") no-repeat scroll -43px 0; display: none; height: 16px; margin-left: 5px; width: 60px; } .course_teacher dl dt span.idec_show { display: inline-block; } .course_teacher dl dd { color: #666565; font-size: 14px; line-height: 24px; } .course_teacher a.teacer_pic { float: left; margin-right: 10px; } .course_teacher .teacer_pic img{ border-radius: 40px; -moz-border-radius: 40px; -webkit-border-radius: 40px; -ms-border-radius: 40px; -o-border-radius: 40px } .course_teacher p{ font-size: 12px; word-wrap: break-word; color: #666; } .course_teacher .discrip{ margin-bottom:20px; font-size:12px } /*边栏教师信息end*/ .chapter_introduces,.chapter_catalog{ color:#303538; font-size:18px; line-height:40px; height: 40px; } .chapter_catalog{ margin-top: 20px; } .course_shortdecription{ color:#60686b; font-size:14px; line-height: 30px; word-break:break-all; white-space:normal } /*outline*/ .course_list{ clear:both; display:inline-block; width:100%; margin-top:12px; } .outline{ width:840px; float:left; padding:40px 40px 0 40px; min-height:800px; background: #fff; -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1); -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.1); box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .outline ul { margin:5px 0 0 0; } .outline li { position: relative; overflow: hidden; padding:15px 0; z-index:2; vertical-align:middle; } .outline_list{ position: relative; margin-left:10px; padding:5px 0; width:775px } em.outline_zt{ background:url(../img/curse_icon.png) no-repeat 0 -264px; width:10px; height:15px; display:none; position:absolute; left:-6px; top:15px; } .outline_name{ color:#60686b; font-size:18px; } .unopen .outline_name{ color:#99a1a6; font-size: 18px; } .unopen .outline_descr{ color:#99a1a6; font-size: 12px; } .outline_descr { color:#60686b; font-size:12px; line-height: 24px; } .outline_listH{ background:#efefef; } .course_right{ float:right; width:260px; } .course_right dl{ clear:both; padding:0 20px; background: #fff; margin-bottom: 20px; -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1); -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.1); box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .course_right dl dt{ border-bottom: 1px solid #d0d6d9; font-size: 16px; height:50px; line-height: 50px } .course_right dl dd{ color:#656e73; font-size:12px; line-height:2em; word-break:break-all; white-space:normal; padding:10px 0; } .course_right .wrd_break{ white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; font-family:Microsoft YaHei,SimSun,Arial; font-size:12px; } a.back-btn{ width:60px; height: 60px; font-size: 36px; display:block; float:left; text-align: center; } a.back-btn:hover{ background: #cc3333; color:#fff; } .course-title{ height:60px; line-height: 60px; overflow:hidden; color:#364247; } .course-title h2,.course-title h1{ float:left; padding-left:10px; font-size:22px; color: #333; } .course_intro{ float:right; width:280px; background: #4d5a61; } .course_description{ height: 200px; line-height: 1.63; overflow: hidden; padding:10px 20px; } .course_notes{ border-bottom:1px solid #4d5559; color:#b4bbbf; padding:10px 20px; } .openicon{ float:left; width:41px; height:41px; display:block; margin:5px 0 0 10px; background: url(../img/course_info_sprit.png) no-repeat 0 -106px; } .unopenicon{ float:left; width:41px; height:41px; display:block; margin:5px 0 0 10px; background: url(../img/course_info_sprit.png) no-repeat 0 -227px; } #couList li a:hover h5{ color:#be3948; text-decoration:underline } #couList li a:hover .openicon{ background: url(../img/course_info_sprit.png) no-repeat 0 -148px; } .path{ font-size:16px; color:#787d80; } .path span{ color:#364247; } .path a{ color:#787d80; }
最后请求的结果如下: