css - 子元素跑到父元素外面
問(wèn)題描述
真的很奇怪 我也不知道什么鬼
mine.vue
<template><p> <p class='search'><input type='text' placeholder='搜索'> </p></p></template><style> .search{width: 100%;height: .5rem;background: #31C27C;clear: both; } .search input{width: calc(100% - .2rem);height: calc(100% - .2rem);border-radius: .05rem;background: #2CAF7A;border: none;margin: .1rem;padding: 0;color: #fff;text-align: center;color: aliceblue }</style>
topnav.vue
<template> <p class='topNav'><span><img src='http://m.baoyu77737.com/img/sort.svg'></span><ul> <li><router-link to='/mine'>我的</router-link></li> <li><router-link to='/musicPavilion'>音樂(lè)館</router-link></li></ul><span><img src='http://m.baoyu77737.com/img/music.svg'></span> </p></template><style> .topNav{width: 100%;height: .5rem;background: #31C27C;list-style: none;font-size: .18rem;font-weight: 600; } .topNav span{width: .6rem;height: .5rem;float: left;cursor: pointer; } .topNav span img{width: .3rem;height: .3rem;padding: .1rem .2rem; } .topNav ul{margin:0 calc(50% - 1.6rem);padding: 0;width:2rem;height: .5rem;float: left; } .topNav ul li{list-style: none;float: left;width: 50%;height: .5rem;text-align: center;line-height: .5rem; }</style>
index.html
<!DOCTYPE html><html><head> <meta charset='utf-8'> <title>qq</title> <meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1; user-scalable=no;'></head><body> <p id='app1'><!--<p class='wrapper'>--><topnav></topnav><router-view></router-view><!-- <mine></mine>--><!--</p>--> </p> <script src='http://m.baoyu77737.com/wenda/app/index.js'></script> <script>(function (doc, win) { var docEl = doc.documentElement,resizeEvt = ’orientationchange’ in window ? ’orientationchange’ : ’resize’,recalc = function () { var clientWidth = docEl.clientWidth; if (!clientWidth) return; if (clientWidth >= 640) {docEl.style.fontSize = ’100px’; } else {docEl.style.fontSize = 100 * (clientWidth / 640) + ’px’; }}; if (!doc.addEventListener) return; win.addEventListener(resizeEvt, recalc, false); doc.addEventListener(’DOMContentLoaded’, recalc, false);})(document, window);//網(wǎng)易適配方案//(function () {// var scale = 1 / devicePixelRatio;// document.querySelector(’meta[name='viewport']’).setAttribute(’content’, ’initial-scale=’ + scale + ’, maximum-scale=’ + scale + ’, minimum-scale=’ + scale + ’, user-scalable=no’);// document.documentElement.style.fontSize = document.documentElement.clientWidth / 10 + ’px’;//})() //淘寶適配方案 </script></body></html>
index.js
import Vue from ’vue’import VueRouter from ’vue-router’import topNav from ’../components/topNav’import mine from ’../components/mine’Vue.use(VueRouter)const router = new VueRouter({ routes: [{ path: ’/mine’, component: mine} ]})export default router
app/index.js
import Vue from ’vue’import router from ’../router’import topnav from ’../components/topNav’require('../style/index.css')var app = new Vue({ el: '#app1', components: {topnav }, router})
問(wèn)題解答
回答1:輸入框加一個(gè)vertical-align:top試試
相關(guān)文章:
1. javascript - 移動(dòng)端自適應(yīng)2. python3.x - c++調(diào)用python33. 前端 - 關(guān)于img父容器的高度會(huì)比img的高度多幾像素的問(wèn)題?4. java - 根據(jù)月份查詢多個(gè)表里的內(nèi)容怎么實(shí)現(xiàn)好?5. atom開(kāi)始輸入!然后按tab只有空格出現(xiàn)沒(méi)有html格式出現(xiàn)6. javascript - 在 model里定義的 引用表模型時(shí),model為undefined。7. css3 - 沒(méi)明白盒子的height隨width的變化這段css是怎樣實(shí)現(xiàn)的?8. css3 - 這個(gè)右下角折角用css怎么畫出來(lái)?9. php工具中的mysql還是5.1以下的,請(qǐng)問(wèn)如何才能升級(jí)到5.1以上?10. apache - 想把之前寫的單機(jī)版 windows 軟件改成網(wǎng)絡(luò)版,讓每個(gè)用戶可以注冊(cè)并登錄。類似 qq 的登陸,怎么架設(shè)服務(wù)器呢?
