Вы должны получить URL-адрес для загрузки этого изображения, используя асинхронный метод getDownloadURL()
.
В документации приведен полный пример: https://firebase.google.com/docs/storage/web/upload-files#full_example
.
If you use position:relative instead of position absolute an empty space will stay in the page structure where the element should be, and this space will be the height of the element you've moved.
So you could float chld1 and chld2 to get them side by side, add top & bottom padding to push chld 3 down and use position relative to split them apart and move to any height. Then use clear both on chld3.
Something like
#exp_outer { width: 400px; border: 1px solid black; } #chld1 { float: left; margin: 30px 0 20px; left: 50px } #chld2 { float: right; margin: 30px 0 20px; right: 50px; } #chld3 { left: 150px; clear: both; } .box { position: relative; width: 80px; height: 80px; border: 1px solid black; }
Child1 Child2 Child3
В итоге я использовал clearfix, это позволяет мне установить желаемую ширину контейнера, и его высота будет скорректирована автоматически, в зависимости от содержимого (это работает во всех браузерах)
<style>
.inner_box {
position: relative;
float: left;
width: 50px;
height: 50px;
border: dashed thin;
margin: 5px 5px 5px;
text-align: center;
}
.outer_box {
position: relative;
top: 200px;
border: solid thin;
width: 190px;
//height: 1%;
}
.outer_box:after {
content: '.';
display: block;
clear: both;
visibility: hidden;
height: 0;
line-height: 0;
}
</style>
<div class="outer_box">
<div class="inner_box">1</div>
<div class="inner_box">2</div>
<div class="inner_box">3</div>
<div class="inner_box">4</div>
<div class="inner_box">5</div>
<div class="inner_box">6</div>
</div>
Если вы задаете div .container высоту 100%, он должен вычисляться по дочерним элементам в большинстве браузеров, но к сожалению, не IE6 или ниже.
Нет. Вся идея в том, что абсолютно позиционированный элемент не влияет на его родительский макет.
Попытайтесь достичь своей цели с помощью относительного позиционирования поплавков вместо абсолютного позиционирования дивов. Это не так удобно (потому что исходное положение ваших поплавков не равно 0,0), но оно будет работать.
overflow: auto
Это новый метод clearfix , к вашему сведению. Однако он не всегда расширяет контейнер до высоты его самого высокого и абсолютно позиционированного дочернего элемента.