div의 오른쪽 하단에 이온 버튼 정렬 (Align an ionic button at the bottom right of a div)


문제 설명

div의 오른쪽 하단에 이온 버튼 정렬 (Align an ionic button at the bottom right of a div)

div의 오른쪽 하단에 이온 버튼을 배치하고 싶습니다. 하지만 예상대로 작동하지 않습니다. 다음은 스크린샷입니다.

여기에 이미지 설명 입력

내 HTML:

이온 블랭크 스타터

  <ion‑slide‑box>
    <ion‑slide ng‑repeat="image in images">
      <div class="slider‑container">
        <img ng‑src="{{image.src}}" style="width:100%;height:auto;margin:0;display:block" >
        <button class="bottom‑right button button‑positive icon‑left ion‑home">Home</button>
      </div>
    </ion‑slide>
  </ion‑slide‑box>

css:

  .slider‑container {
    margin: 0;
    padding:0;
    position:relative;
  }

  .bottom‑right {
    position:absolute;
    bottom: 0;
    right: 0;
  }

누군가 도와줄 수 있습니까? 감사합니다.


참조 솔루션

방법 1:

When I needed to put the left and right buttons ("<" and ">") I used class "row" and "col"

    <div class="row">
        <div class="col col‑10">
            <button class="button button‑block button‑icon button‑clear ion‑chevron‑left" ng‑click="slidePrevious()"></button>
        </div>
        <div class="col">
            <ion‑slide‑box on‑slide‑changed="mudaSlide($index)">
                <ion‑slide ng‑repeat="i in items">
                    <img class="button " ng‑src="{{i.imagem}}" style="width: 128px; height: 128px; padding: 0; border: none; background: none;" ng‑click="abreExibecaoImagem($index)"></img>                        
                </ion‑slide>
            </ion‑slide‑box>
        </div>
        <div class="col col‑10">
            <button class="button button‑block button‑icon button‑clear ion‑chevron‑right" ng‑click="slideNext()"></button>
        </div>
    </div>

Result

enter image description here

방법 2:

And why not to do it this way?

  <ion‑slide‑box>
    <ion‑slide ng‑repeat="image in images">
      <div class="slider‑container">
        <img ng‑src="{{image.src}}" style="width:100%;height:auto;margin:0;display:block" >
      </div>
    </ion‑slide>
  </ion‑slide‑box>
  <div class="slider‑container">
    <button class="bottom‑right button button‑positive icon‑left ion‑home">Home</button>
  </div>

...moving the button (and the container <div>) out of the slider.

(by BagusflyerAdsHanbeaver)

참조 문서

  1. Align an ionic button at the bottom right of a div (CC BY‑SA 2.5/3.0/4.0)

#ionic #css #html






관련 질문

Cordova - OS 업그레이드 후 iOS/Android 모두에서 앱 충돌 (Cordova - app crashes on both iOS/Android after an OS upgrade)

모바일용 HTML 5의 특정 영역에 링크가 있는 이미지 (Image with links in certain areas in HTML 5 for mobile)

Play 스토어에서 오류 발생 - "이 앱은 모든 기기와 호환되지 않습니다." (Getting error from play store - “This app is incompatible with all of your devices.”)

div의 오른쪽 하단에 이온 버튼 정렬 (Align an ionic button at the bottom right of a div)

새로운 Xcode 프로비저닝 정책 및 Ionic Framework (New Xcode provisioning policy and Ionic Framework)

각도 [$injector:unpr] 알 수 없는 공급자 오류를 해결하는 방법? (How to solve angular [$injector:unpr] Unknown provider error?)

ionic, 팝오버 범위에 범위 변수 전달 (ionic, pass scope variable to popover scope)

Angular: 2필드 데이터 바인딩 문제 (Angular: issue with two-field data binding)

ionic 2에서 ion-title의 글꼴 색상 변경 (Change font color of ion-title in ionic 2)

PhoneGap 빌드가 내 모든 파일을 업데이트하지 않습니다. (PhoneGap build is not updating all of my files)

Ionic 빌드 Android를 수행하는 동안 오류가 발생했습니다. (Error while doing Ionic build android)

$ionicHistory.backView() stateParams 변경 후 돌아가기 (Going back after changing stateParams of $ionicHistory.backView())







코멘트