Trying to make responsive layout for my app with flexbox.
Flexbox working incorrect at safari.
When direction is row, all working right.
But for column layout broken. Having not idea why.
Already tried changing prefixes.(not autoprefix problem)
At chrome: gif
At safari: gif
sass:
$right-section-color: #98ee99
$left-section-color: fade_out(grey,0.8)
$font-color: fade_out(black,0.3)
.AllSection
width: 100%
color: $font-color
.Banner
#extend .BannerSection
.section
display: flex
justify-content: center
flex-direction: row
span
margin: auto
padding: 0
flex: 1
.imageWithText
flex: 1
margin: auto
display: flex
flex-direction: column
text-align: center
img
max-width: 10em
height: 100%
width: 100%
margin: auto
.text
flex: 1
margin: auto
#for $i from 1 through 5
#if($i % 2 == 0)
.section:nth-child(#{$i})
background-color: $left-section-color
#media #{$small-and-down}
flex-direction: column
#else
.section:nth-child(#{$i})
background-color: $right-section-color
#media #{$small-and-down}
flex-direction: column-reverse
jsx:
<Element name="AllSection" className="AllSection">
<div className="Banner">
<h3>Диспоузер Status це</h3>
</div>
<div className="section">
<div className="imageWithText">
<img src={ecoLogo} id='ecoLogo' alt="eco logo" />
<span>Екологічно</span>
</div>
<div className="text">
<span>Використання подрібнювача скорочує обсяг перевезеного на звалища сміття. Крім того, харчові
відходи є сировиною для виробництва біогазу. </span>
</div>
</div>
<div className="section">
<div className="text">
<span>Подрібнювачі миттєво усувають харчові відходи c кухні. Тепер не потрібно зберігати їх в сміттєвому відрі - джерелі неприємних запахів і бактерій.</span>
</div>
<div className="imageWithText">
<img src={wastedFood} alt="wasted food" />
<span>Гігієнічно</span>
</div>
</div>
<div className="section">
<div className="imageWithText">
<img src={kitchenPicture} alt="kitchen washer" />
<span>Практично</span>
</div>
<div className="text">
<span>Подрібнювач акуратно і легко встановлюється під раковину і не вимагає додаткових площ на
кухні. </span>
</div>
</div>
<div className="section">
<div className="text">
<span>Подрібнювач абсолютно безпечний для дітей і дорослих. Всередині немає ножів і шнеків.
Додаткову електробезпеку забезпечує пневмовимикач. </span>
</div>
<div className="imageWithText">
<img src={safetyIcon} alt="wasted food" />
<span>Безпечно</span>
</div>
</div>
</Element>
App created by react-create-app, so i have autoprefixer.
How can I fix this layout in safari?
UPDATE:
When setting width to 50% of element i want to layout, all working.
But how can i make it with flex: 1?
Related
I am creating a landpaging and I am facing some style difficulties due to lack of practice.
I want to modify the backgroud of the navbar, so I wanted to make the background transparent so that the bottom of the page appears. How can I do this?
enter image description here
<template>
<div class="Shellhub-LP-1280">
<div class="textura Nuvem">
<b-navbar>
<template slot="brand">
<b-navbar-item tag="router-link" :to="{ path: '/' }" transparent="true">
<img
src="https://raw.githubusercontent.com/buefy/buefy/dev/static/img/buefy-logo.png"
alt="Lightweight UI components for Vue.js based on Bulma"
>
<!-- <img src="#/static/logo-inverted.png"> -->
</b-navbar-item>
</template>
...
</b-navbar>
</div>
</div>
</template>
<style>
.Shellhub-LP-1280 {
/* width: 100%; */
height: 2283px;
background-color: #333640;
}
.textura {
/* width: 100%; */
height: 771px;
}
.Nuvem {
width: 100%;
height: 755px;
object-fit: contain;
opacity: 0.9;
float: right;
background: url('../static/nuvem.png');
background-repeat: no-repeat;
background-position: right;
}
Thanks
buefy navbar API:
https://buefy.org/documentation/navbar/#api-view
Passing this props:
<b-navbar :fixed-top="true" :transparent="true" >
Vue docs - components props (recommend to read):
https://v2.vuejs.org/v2/guide/components-props.html
transparent "bug":
Open github issue:
BUG: navbar is-transparent not working .
IMPORTANT: transparent affect navbar items (Not the navbar wrapper himself).
Remove any hover or active background from the navbar items
So add simple CSS styling:
nav.navbar.is-fixed-top {
background: transparent;
}
body top padding issue
I won't find a way to remove body top padding. I added this style:
body{
padding-top: 0px!important;
}
Basic example:
const app = new Vue()
app.$mount('#app')
img.responsive_img{
width: 100%;
height: auto;
}
body{
padding-top: 0px!important;
}
/* change navbar background color */
nav.navbar.is-fixed-top {
background: transparent;
}
<link href="https://unpkg.com/buefy/dist/buefy.min.css" rel="stylesheet"/>
<div id="app">
<b-navbar class="is-link" :fixed-top="true" :transparent="true">
<template slot="brand">
<b-navbar-item tag="router-link" :to="{ path: '/' }">
<img
src="https://raw.githubusercontent.com/buefy/buefy/dev/static/img/buefy-logo.png"
alt="Lightweight UI components for Vue.js based on Bulma"
>
</b-navbar-item>
</template>
<template slot="start">
<b-navbar-item href="#">
Home
</b-navbar-item>
<b-navbar-item href="#">
Documentation
</b-navbar-item>
<b-navbar-dropdown label="Info">
<b-navbar-item href="#">
About
</b-navbar-item>
<b-navbar-item href="#">
Contact
</b-navbar-item>
</b-navbar-dropdown>
</template>
<template slot="end">
<b-navbar-item tag="div">
<div class="buttons">
<a class="button is-primary">
<strong>Sign up</strong>
</a>
<a class="button is-light">
Log in
</a>
</div>
</b-navbar-item>
</template>
</b-navbar>
<header style="min-height: 200vh;">
<img class="responsive_img" src="https://picsum.photos/2000/600"/>
</header>
</div>
<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
<script src="https://unpkg.com/buefy/dist/buefy.min.js"></script>
Change navbar background color on scroll
only by custom code
See this codepen (I added a class on scroll):
https://codepen.io/ezra_siton/pen/jOPZgmR
Change the background color on scroll her:
nav.navbar.is-fixed-top.isActive{
transition: background-color 0.5s ease;
background: red; /* change color on scroll */
}
Change navbar links color to white (For dark hero) - add "is-link" modifier:
https://bulma.io/documentation/components/navbar/#colors
<b-navbar class="is-link" :fixed-top="true" :transparent="true" >
Remove hover/active
:transparent="true"
Remove any hover or active background from the navbar items.
I'm using bootstrap 4 input-group and appending or pretending my inputs with add-ons as labels.
For the inputs its looking good. Now I need a multi-line add-on or label for text area.
I'm looking for best possible solution in Bootstrap or CSS.
Here is the code I'm trying.
<style>
.h-unset {
height: unset !important;
}
.multiline-label {
display: inline-block;
word-wrap: break-word;
word-break: break-word;
width: 100%;
}
</style>
<div class="input-group input-group-sm mb-3 row mx-0">
<div class="input-group-prepend col-md-3 px-0">
<label for="naastVastgoedbeleg-ging"
class="input-group-text w-100 rounded-0 multiline-label h-unset"
id="label-naastVastgoedbeleg-ging">
<strong>Werkzaamheden naast vastgoedbeleg-ging (bijv. loondienst of onderneming)</strong>
</label>
</div>
<textarea id="naastVastgoedbeleg-ging"
class="form-control rounded-0 col-md-9 h-unset"
aria-label="naastVastgoedbeleg-ging"
aria-describedby="label-naastVastgoedbeleg-ging">
</textarea>
</div>
Thankx for helping Happy Coding!
It worked by using this css
.multiline-label strong {
white-space: pre-wrap;
}
From what I've learned about <amp-carousel> it has only 2 types of carousel interface: carousel and slides, which you can see on the AMP example website. I need to create something like this, multiple columned carousel. Is AMP carousel able to achieve this?
You can't customize amp-carousel the way you want, you need to check out amp-base-carousel which allows you to set visible-count, advance-count and other useful properties.
The documentation.
Example :
<amp-base-carousel
loop="true"
height="450"
layout="fixed-height"
visible-count="(min-width: 1150px) 3, (min-width: 700px) 2, 1"
advance-count="(min-width: 1150px) 3, (min-width: 700px) 2, 1"
>
<div>slide1</div>
<div>slide2</div>
<div>slide3</div>
<div>slide4</div>
<button slot="next-arrow" class="carousel-next" aria-label="Next">
<i class="fas fa-chevron-circle-right"></i>
</button>
<button slot="prev-arrow" class="carousel-prev" aria-label="Previous">
<i class="fas fa-chevron-circle-left"></i>
</button>
</amp-base-carousel>
With some style for the buttons :
.carousel-prev, .carousel-next {
filter: drop-shadow(0px 1px 2px #4a4a4a);
width: 40px;
height: 40px;
padding: 20px;
background-color: transparent;
border: none;
outline: none;
font-size: 24px;
opacity:0.7;
}
In a way, yes.
You can use the slide interface, in under each section, but 4 entries.
<amp-carousel height="300" layout="fixed-height" type="slides">
<div>
<div class="blue-box"> 1 </div>
<div class="red-box"> 2 </div>
<div class="green-box"> 3 </div>
<div class="yellow-box"> 4 </div>
</div>
<div>
<div class="blue-box"> 9 </div>
<div class="red-box"> 8 </div>
<div class="green-box"> 7 </div>
<div class="yellow-box"> 6 </div>
</div>
</amp-carousel>
I understand it won't be shifting with one entry at a time, but I suppose it would be near to what you want
I have a button:
<button class="pure-field-button" type="button" id="yui_3_5_0_1_1394785205896_6061" style="background-color: rgb(238, 238, 238);"><i class="fa fa-user"></i></button>
Here is what I get and verify in Firepath, no any error in Firepath
//button[contains(#id, 'yui_3_5_0_1') and #class="pure-field-button"]
when I try to put it Selenium IDE
Command: click
Target: //button[contains(#id, 'yui_3_5_0_1') and #class="pure-field-button"]
Error: locator not found
Any suggestion?
Code. The button is in the last row
<head>
<body id="yui_3_5_0_1_1394792924659_843" class="yui3-skin-sam">
<div class="yui3-widget-mask" style="position: fixed; width: 100%; height: 100%; top: 0px; left: 0px; z-index: 2;"></div>
<div id="yui_3_5_0_1_1394792924659_5326" class="yui3-dd-draggable yui3-widget yui3-panel yui3-widget-positioned yui3-widget-modal yui3-widget-stacked yui3-panel-focused" style="width: 610px; left: 323px; top: 263.5px; z-index: 2;" tabindex="0">
<div id="yui_3_5_0_1_1394792924659_5327" class="yui3-panel-content yui3-widget-stdmod">
<div class="yui3-widget-hd">Новый абонент</div>
<div id="yui_3_5_0_1_1394792924659_5555" class="yui3-widget-bd">
<div id="yui_3_5_0_1_1394792924659_5554" class="form-container">
<form id="yui_3_5_0_1_1394792924659_2237" class="pure-form pure-g">
<div class="block-overlay" hidden="hidden" style="display: none; width: 594px; height: 177px;">
<fieldset id="yui_3_5_0_1_1394792924659_5553" class="pure-u-1">
<legend>
<div id="yui_3_5_0_1_1394792924659_5552" class="pure-field-group pure-field-with-button required">
<div class="pure-u-11-24 pure-field-label-container">
<div id="yui_3_5_0_1_1394792924659_5551" class="pure-u-11-24">
<button id="yui_3_5_0_1_1394792924659_5550" class="pure-field-button" type="button">
If CSS locators are welcome, you can try this one:
css=button[#id^="yui_3_5_0_1"][#class="pure-field-button"]
You can try searching by Id instead of xpath.
By.id("yui_3_5_0_1_1394785205896_6061");
Let me know if that works.
I want to create a header similar to facebook where position:fixed. and when you zoom-out the whole page centers itself and when I zoom-in the header also streches..
When I use position:fixed and zoom-in some contents disappear due to lack of space on the window..
<div id="header_line" ></div>
<div id="header">
<div id="heading_name" >Home </div>
<div id="heading_name" style="left:28%;">Advertisement Board</div>
<div id="heading_name" style="left:46%;">Advertise</div>
<div id="heading_name" style="left:60%;">Sign In</div>
<div id="heading_name" style="left:76%;">About Us</div>
</div>
<style>
#header_line{
position:fixed;
top:0%;
left:0%;
width:1370px;
height:7px;
z-index:20;
background-color:#F60;
}
#header{
position:fixed;
left: 0px;
z-index:20;
top: 7px;
width:1370px;
height: 30px;
background-color:#003;
border-bottom:thick;
border-bottom-color:#000;
box-shadow:2px 5px 5px 1px #033;
}
</style>