HTML 第七章:浮动 课后作业

本文详细探讨了HTML中的浮动概念,讲解如何使用浮动实现页面元素的布局,并结合课后作业提供了实例解析,帮助读者深入理解并掌握浮动在网页设计中的应用。

1.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>摄影社区热门小镇</title>
     <style>
         #Ba{width:520px;height:250px;margin:0px auto;border: 1px solid gray;padding: 0px 10px}
         h5{padding: 10px 10px;margin: 0px;color: grey}
         ul {list-style-type: none;padding: 0px 5px}
         li strong{color: #388DFF;font-size: 12px}   span{color: gray;font-size: 10px}
         img{border: 1px solid gray;border-radius:8px;padding:3px;margin-left:10px;}
         img:nth-of-type(3){margin-left:35px}
     </style>
</head>
<body>
       <div id="Ba">
         <h5>摄影社区热门小镇</h5>
           <img src="images/pic_01.jpg"/>
         <ul style="display: inline-block">
             <li><strong>风景狙击手</strong></li>
             <li><span>成员:80</span></li>
             <li><span>作品:276</span></li>
         </ul>
           <img src="images/pic_02.jpg"/>
           <ul style="display: inline-block">
             <li><strong>叙事感</strong></li>
             <li><span>成员:235</span></li>
             <li><span>作品:116</span></li>
         </ul>
           <img src="images/pic_03.jpg " />
           <ul style="display: inline-block;">
               <li><strong>定焦视界</strong></li>
               <li><span>成员:56</span></li>
               <li><span>作品:456</span></li>
           </ul>
           <img src="images/pic_04.jpg"/>
           <ul style="display: inline-block">
               <li><strong>中画幅乐园</strong></li>
               <li><span>成员:130</span></li>
               
下面是整合的的步骤 spring整合hibernate 加入jar包 加入spring和aop所需必须包 加入hibernate的必须包 spring整合hibernate的必须包 org.springframework.jdbc-3.1.3.RELEASE.jar org.springframework.orm-3.1.3.RELEASE.jar org.springframework.transaction-3.1.3.RELEASE.jar 加入配置文件 加入spring的配置文件 加入hibernate的配置文件 加入配置代码 加入对SessionFactory的配置 加入数据源(DataSource)的配置 <bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> <property name="driverClass" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/test"/> <property name="username" value="root"/> <property name="password" value=""/> </bean> 加入SessionFactory的配置 <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <!-- 配置session factory使用的数据源 --> <property name="dataSource" ref="dataSource" /> <!-- 配置使用hibernate的配置文件 --> <!--<property name="configLocation" value="classpath*:hibernate.cfg.xml" /> --> <!-- 无需写hibernate的配置文件,而是将hibernate的配置直接加入到spring配置文件中 配置hibernate的映射文件地址 --> <property name="mappingResources"> <list> <value>com/direct/domain/Employee.hbm.xml</value> <value>com/direct/domain/Log.hbm.xml</value> </list> </property> <!-- 配置hibernate的其他属性 --> <property name="hibernateProperties"> <map> <entry key="dialect" value="org.hibernate.dialect.MySQL5Dialect" /> <entry key="show_sql" value="true" /> <entry key="format_sql" value="true" /> <entry key="current_session_context_class" value="thread" /> </map> </property> </bean> 加入事务管理切面类的配置 <!-- 创建事务管理器(spring针对hibernate实现的事务管理的切面类) --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- 事务的通知类型 --> <tx:advice id="transactionAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED"/> <tx:method name="update*" propagation="REQUIRED"/> <tx:method name="delete*" propagation="REQUIRED"/> <tx:method name="*" read-only="true" /> <!-- 或者 <tx:method name="*list*" read-only="true"/> <tx:method name="*get*" read-only="true"/> <tx:method name="*" propagation="REQUIRED"/> --> </tx:attributes> </tx:advice> 将切面类应用到切入点上 <!-- 将事务管理规则的切面应用到对应的切入点 --> <aop:config> <aop:pointcut expression="execution(* com.direct.service.*.*(..))" id="transactionPointCut"/> <aop:advisor advice-ref="transactionAdvice" pointcut-ref="transactionPointCut"/> </aop:config> spring和struts2的整合 加入整合包 加入struts的必须包 struts整合spring的包 struts2-spring-plugin-2.3.15.3.jar spring整合struts的包 org.springframework.web-3.1.3.RELEASE.jar org.springframework.web.servlet-3.1.3.RELEASE.jar org.springframework.web.struts-3.1.3.RELEASE.jar 加入struts的配置文件struts.xml 在web.xml中配置struts <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> 在web.xml配置spring <!-- 配置spring的配置文件的位置 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:applicationContext-*.xml</param-value> </context-param> <!-- 配置spring随web容器启动时就创建 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> 在struts.xml中配置对象创建工具为spring <constant name="struts.objectFactory" value="spring" />
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值