内部div超出了主要div的外部

时间:2018-06-03 14:15:10

标签: html css

我的主要div中有三个div。但是一个div正在主要div之外。我不明白,这样的事情怎么会发生?

如果有人可以帮助我......我会非常感激=)



ext {
apply from: 'CordovaLib/cordova.gradle'
// The value for android.compileSdkVersion.
if (!project.hasProperty('cdvCompileSdkVersion')) {
    cdvCompileSdkVersion = 27;
}
// The value for android.buildToolsVersion.
if (!project.hasProperty('cdvBuildToolsVersion')) {
    cdvBuildToolsVersion = "26.0.2";
}
// Sets the versionCode to the given value.
if (!project.hasProperty('cdvVersionCode')) {
    cdvVersionCode = 1
}
// Sets the minSdkVersion to the given value.
if (!project.hasProperty('cdvMinSdkVersion')) {
    cdvMinSdkVersion = 15
}
// Whether to build architecture-specific APKs.
if (!project.hasProperty('cdvBuildMultipleApks')) {
    cdvBuildMultipleApks = null
}
// .properties files to use for release signing.
if (!project.hasProperty('cdvReleaseSigningPropertiesFile')) {
    cdvReleaseSigningPropertiesFile = null
}
// .properties files to use for debug signing.
if (!project.hasProperty('cdvDebugSigningPropertiesFile')) {
    cdvDebugSigningPropertiesFile = null
}
// Set by build.js script.
if (!project.hasProperty('cdvBuildArch')) {
    cdvBuildArch = null
}

// Plugin gradle extensions can append to this to have code run at the end.
cdvPluginPostBuildExtras = []

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
debugCompile(project(path: "CordovaLib", configuration: "debug"))
releaseCompile(project(path: "CordovaLib", configuration: "release"))
compile "com.android.support:support-v4:24.1.1+"
compile "com.android.support:support-v4:+"
compile "com.android.support:appcompat-v7:+"
compile "com.google.android.gms:play-services-location:+"
compile "com.android.support:support-v13:23+"
compile "com.google.android.gms:play-services-gcm:11+"
compile "me.leolin:ShortcutBadger:1.1.14@aar"
// SUB-PROJECT DEPENDENCIES END




1 个答案:

答案 0 :(得分:0)

您必须更改<div class="test8">元素的顺序,并将其更改为float:right而不是float:left。试试这段代码。

<div class="test1">
  <div class="test8">
  </div>
  <div class="test6">
  </div>
  <div class="test7">
  </div>
</div>

.test1 {
  width: 1000px;
  height: 200px;
  background-color: yellow;
  margin: auto;
}

.test6 {
  width: 700px;
  height: 100px;
  background-color: black;
  float: left;
}

.test7 {
  width: 700px;
  height: 100px;
  background-color: pink;
  float: left;
}

.test8 {
  width: 300px;
  height: 200px;
  background-color: green;
  float: right;
}