zoukankan      html  css  js  c++  java
  • css使用

    图片在div内垂直居中

    <!DOCTYPE html>
    <html>
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    		<title>RunJS</title>
    		<style>
    			div{
    				line-height: 300px;
    				border:1px solid red
    			}
    			img{
    					vertical-align: middle;
    				}
    		</style>
    	</head>
    	<body>
    		<div id="div1">
    				<img src="http://lorempixel.com/400/200/">
    		</div>
    	</body>
    </html>
    

    省略号(block,inline)

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
            div,p{
                 100px;
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
                background: red;
            }
            span{
                display: block;/* 先转化成block */
                 100px;
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
                background: green;
            }
        </style>
    </head>
    <body>
        <div>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>
        <p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
        <span>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span>
    </body>
    </html>
    

  • 相关阅读:
    node 搭建代理服务器
    jquery常见的方法
    静态布局字体标签
    ajax简单了解
    GET方式缓存清除
    Ajax使用概述
    SESSION技术
    COOKIE技术
    PHP操作数据库(二)-增删改查操作
    PHP操作数据库(一)-步骤介绍
  • 原文地址:https://www.cnblogs.com/leee/p/7346431.html
Copyright © 2011-2022 走看看