本文咱們在前文基礎上引入一個例子,邊作邊聊控制器。css
咱們想實現一個課程查詢的功能。html
首先大腦應該條件反射——如何定義MVC。前端
M:課程(包含章節)——Course(包含Chapter)java
V:課程頁面——course_overview.jspandroid
C:編寫一個控制器接收springMVC前端控制器dispatcherServlet的請求轉發——CourseControllerweb
另外,Service——一些業務邏輯調用——業務接口CourseService,業務實現CourseServiceImplspring
而後,在思考如何在springMVC下組織上述各個部分。express
C控制器是M、V、Service的中間橋樑,如何組織都是圍繞着C展開的。apache
請求URL由springMVC前端控制器dispatcherServlet轉發給控制器C——在web.xml配置dispatcherServlet,給出前端控制器配置文件路徑json
如何標記控制器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" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>HappyBKs喜歡原先的osc博客頁面</title> <link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/main.css" type="text/css" /> </head> <body> <div id="main"> <div class="newcontainer" id="course_intro"> <div class="course-title">${course.title}</div> <div class="course_info"> <div class="course-embed l"> <div id="js-course-img" class="img-wrap"> <img width="600" height="340" alt="" src="<%=request.getContextPath()%>/${course.imgPath}" class="course_video" /> </div> <div id="js-video-wrap" class="video" style="display: none"> <div class="video_box" id="js-video"></div> </div> </div> <div class="course_state"> <ul> <li><span>學習人數</span> <em>${course.learningNum }</em></li> <li class="course_hour"><span>課程時長</span> <em class="ft-adjust"><span>${course.duration }</span>秒</em></li> <li><span>課程難度</span> <em>${course.levelDesc }</em></li> </ul> </div> </div> <div class="course_list"> <div class="outline"> <h3 class="chapter_introduces">課程介紹</h3> <div class="course_shortdecription">${course.descr}</div> <h3 class="chapter_catalog">課程提綱</h3> <ul id="couList"> <c:forEach items="${course.chapterList}" var="chapter"> <li class="clearfix open"><a href="#"> <div class="openicon"></div> <div class="outline_list l"> <!-- <em class="outline_zt"></em> --> <h5 class="outline_name">${chapter.title }</h5> <p class="outline_descr">${chapter.descr }</p> </div> </a></li> </c:forEach> </ul> </div> </div> </div> </div> </body> </html>
值得注意的是,這裏的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<Chapter> chapterList = new ArrayList<Chapter>(); warpChapterList(courseId,chapterList); course.setChapterList(chapterList); return course; } private void warpChapterList(Integer courseId,List<Chapter> 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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>testIdea.happBKs.mvc</groupId> <artifactId>springMVC</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>springMVC Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <commons-lang.version>2.6</commons-lang.version> <slf4j.version>1.7.21</slf4j.version> <spring.version>4.2.6.RELEASE</spring.version> <jackson.version>2.7.4</jackson.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-framework-bom</artifactId> <version>${spring.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>${commons-lang.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> <exclusions> <exclusion> <artifactId>slf4j-api</artifactId> <groupId>org.slf4j</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> </dependencies> <build> <finalName>springMVC</finalName> </build> </project>
還須要一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
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <!-- 本配置文件是工名爲mvc-dispatcher的DispatcherServlet使用, 提供其相關的Spring MVC配置 --> <!-- 啓用Spring基於annotation的DI, 使用戶能夠在Spring MVC中使用Spring的強大功能。 激活 @Required @Autowired,JSR 250's @PostConstruct, @PreDestroy and @Resource 等標註 --> <context:annotation-config /> <!-- DispatcherServlet上下文, 只管理@Controller類型的bean, 忽略其餘型的bean, 如@Service --> <context:component-scan base-package="com.happyBKs.controller"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> </context:component-scan> <!-- HandlerMapping, 無需配置, Spring MVC能夠默認啓動。 DefaultAnnotationHandlerMapping annotation-driven HandlerMapping --> <!-- 擴充了註解驅動,能夠將請求參數綁定到控制器參數 --> <mvc:annotation-driven /> <!-- 靜態資源處理, css, js, imgs --> <mvc:resources mapping="/resources/**" location="/resources/" /> <!-- 配置ViewResolver。 能夠用多個ViewResolver。 使用order屬性排序。 InternalResourceViewResolver放在最後。 --> <!--<bean--> <!--class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">--> <!--<property name="order" value="1" />--> <!--<property name="mediaTypes">--> <!--<map>--> <!--<entry key="json" value="application/json" />--> <!--<entry key="xml" value="application/xml" />--> <!--<entry key="htm" value="text/html" />--> <!--</map>--> <!--</property>--> <!--<property name="defaultViews">--> <!--<list>--> <!--<!– JSON View –>--> <!--<bean--> <!--class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">--> <!--</bean>--> <!--</list>--> <!--</property>--> <!--<property name="ignoreAcceptHeader" value="true" />--> <!--</bean>--> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="prefix" value="/WEB-INF/jsps/" /> <property name="suffix" value=".jsp" /> </bean> <!--200*1024*1024即200M resolveLazily屬性啓用是爲了推遲文件解析,以便捕獲文件大小異常 --> <!--<bean id="multipartResolver"--> <!--class="org.springframework.web.multipart.commons.CommonsMultipartResolver">--> <!--<property name="maxUploadSize" value="209715200" />--> <!--<property name="defaultEncoding" value="UTF-8" />--> <!--<property name="resolveLazily" value="true" />--> <!--</bean>--> </beans>
spring容器配置文件applicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <context:annotation-config /> <context:component-scan base-package="com.happyBKs"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" /> </context:component-scan> </beans>
另外須要一些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; }
最後請求的結果以下: