內聯元素居中

父元素:
height:100px;
line-height:100px; // 與高相同
text-align:center;
子元素:
display:inline;
vertical-align: middle;

適用圖片、文字

<div><div class="wrapper"><span>我是文字</span></div><div class="wrapper2"><div>我是文字</div></div></div>
.wrapper {height: 200px;width: 200px;background-color: antiquewhite;line-height: 200px;
}
.wrapper2 {height: 200px;width: 200px;background-color: antiquewhite;line-height: 200px;div{height: 20px;width: 20px;}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278643.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278643.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278643.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

防止html標簽轉義

function htmlDecode ( str ) {var ele document.createElement(span);ele.innerHTML str;return ele.textContent;} 例如body下邊所有的p標簽都防止轉義&#xff1a; $.each($("body").find(p),function(){this.innerHTML htmlDecode(this.innerHTML);}); 轉載于…

新垣結衣自拍照_如何阻止自拍照出現在iPhone的自拍照專輯中

新垣結衣自拍照Khamosh PathakKhamosh PathakThe Photos app on your iPhone automatically populates all photos from the front-facing camera in the Selfies album. But what if you don’t want a photo to appear there? Here are a couple of solutions. iPhone上的“…

前端個人筆記

前端個人筆記1.vue項目安裝依賴/插件時忘記--save&#xff0c;再次install出問題并且沒有報錯。2.margin移動元素不顯示背景色3.新知識&#xff1a;media 條件樣式4.入坑&#xff1a;row和col不能分離&#xff0c;span24不能不寫5.聚焦實現滾動到指定元素1.vue項目安裝依賴/插件…

kernel中對文件的讀寫【學習筆記】【原創】

/*1. 頭文件 */ #include <linux/init.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/fs.h> #include <linux/uaccess.h>MODULE_PARM_DESC(iva…

ssm項目快速搭建(注解)-依賴

父層jar包版本控制&#xff0c;管理配置 <!-- 集中定義依賴版本號 --> <properties> <junit.version>4.12</junit.version> <spring.version>4.2.4.RELEASE</spring.version> <pagehelper.version>4.0.0<…

如何設置自定義任務欄圖標_如何為任何應用程序自定義Windows 7任務欄圖標

如何設置自定義任務欄圖標Would you like to change out the icons on your taskbar with a beautiful set of icons that all go together? Here’s how you can change out the random candy-colored icons for a stylish icon set of your choice. 您是否要用一組漂亮的圖…

給谷歌瀏覽器安裝vue調試工具:vue-devtools

安裝vue-devtools一、拉取項目二、install、build三、添加擴展四、使用舉例一、拉取項目 vue-devtools&#xff1a;git地址&#xff08;master分支&#xff09; 非master分支在build的時候會報錯。 二、install、build 1、打開cmd進入項目目錄&#xff0c;可以選擇npm/cnpm/…

如何找到Windows 7或8家庭組密碼?

So you’re about to setup your new Windows 7 PC into your Homegroup when you realized that you have no idea what the password is. How do you find it? It’s actually pretty simple, if you know where to look. 因此&#xff0c;當您意識到自己不知道密碼是什么時…

vue3.0、cli4項目引入element plus

element團隊為新版的 vue-cli4 準備了相應的 Element Plus 插件 安裝依賴 npm install element-plus --savemain.js全局引入&#xff0c;樣式文件需要單獨引入 import { createApp } from vue import ElementPlus from element-plus; import element-plus/lib/theme-chalk/in…

MySQL索引背后的數據結構及算法原理

title: MySQL索引背后的數據結構及算法原理 date: 2018-07-25 19:50:16 tags: mysql categories: mysql --- 本文轉載自http://blog.codinglabs.org/articles/theory-of-mysql-index.html 摘要 本文以MySQL為研究對象&#xff0c;討論與數據庫索引相關的一些話題。特別需要說明…

[SDOI2015]約數個數和

Sol 首先有個結論\(\sum_{i1}^{m}\sum_{j1}^{n}d(i*j)\sum_{i1}^{m}\sum_{j1}^{n}\sum_{x|i}\sum_{y|i}[gcd(x,y)1]\) 證明&#xff1a;可以看po姐的博客 接著這個式子推\[ 原式\sum_{x1}^{n}\sum_{y1}^{m}([gcd(x, y)1] * \sum_{x|i}\sum_{y|i} 1)\\ \sum_{x1}^{n}\sum_{y1}^{…

使用mcBackup備份Windows 7 Media Center設置

If you’re a HTPC enthusiast and use Windows 7 Media Center, you probably have a lot of scheduled recordings and channel lineups you’d like to backup. Here we take a look at a simple tool that will allow you to do it easily. 如果您是HTPC愛好者并且使用Wind…

【CF961G】Partitions(第二類斯特林數)

【CF961G】Partitions&#xff08;第二類斯特林數&#xff09; 題面 CodeForces洛谷 題解 考慮每個數的貢獻&#xff0c;顯然每個數前面貢獻的系數都是一樣的。 枚舉當前數所在的集合大小&#xff0c;所以前面的系數\(p\)就是&#xff1a;\[\begin{aligned} p&\sum_{i1}^n{…

js綁定事件和阻止事件

js事件一、綁定事件1、html綁定2、el屬性綁定3、el函數綁定4、事件捕獲與冒泡5、js常見事件稱名二、阻止事件1、event.stopPropagation()2、return false3、event.preventDefault();4、兼容寫法一、綁定事件 1、html綁定 <div onclick"alert(click!)">click&…

linux中service的問題

1.描述問題 2.解決方案 systemctl stop firewalld systemctl mask firewalldThen, install the iptables-services package: yum install iptables-servicesEnable the service at boot-time: systemctl enable iptablesManaging the service systemctl [stop|start|restart] i…

火狐可以打開谷歌打不開_如何設置Firefox以使用Google Apps打開所有內容

火狐可以打開谷歌打不開Google offers a pretty comprehensive set of online applications which many of you probably take advantage of. Here is how to easily configure Firefox to use Google’s online offerings for email, RSS, PDF and office documents as your d…

設置第三方的SMTP服務

取得授權碼: 轉載于:https://www.cnblogs.com/0909/p/10153499.html

表單重復提交問題

2019獨角獸企業重金招聘Python工程師標準>>> 為什么會發生表單重復提交呢&#xff1f; 網絡延時 在平時開發中&#xff0c;如果網速比較慢的情況下&#xff0c;用戶提交表單后&#xff0c;發現服務器半天都沒有響應&#xff0c;那么用戶可能會以為是自己沒有提交表單…

js事件名稱集

一般事件 名稱描述onClick鼠標點擊事件&#xff0c;多用在某個對象控制的范圍內的鼠標點擊onDblClick鼠標雙擊事件onMouseDown鼠標上的按鈕被按下了onMouseUp鼠標按下后&#xff0c;松開時激發的事件onMouseOver當鼠標移動到某對象范圍的上方時觸發的事件onMouseMove鼠標移動時…

chrome 網頁重新加載_在Chrome中為各個網頁設置自定義重新加載時間

chrome 網頁重新加載Do you have a webpage that needs to be reloaded every so often or perhaps you have multiple webpages that each need their own individual reload time? Now you can have the best of both with the AutoReloader extension for Google Chrome. 您…