I'm wondering if there's a better way to set the height of a grid row in Ionic 5 than simply overriding the default styles. Including an extra style to every row that I need to have a specified height is a bit tedious, and it seems like there should be a better way.
<IonGrid style={{ height: "100%" }}>
<IonRow style={{height: "100%"}}>
<IonCol>Hi</IonCol>
<IonCol>Hi Again</IonCol>
<IonCol>Hi A third time</IonCol>
</IonRow>
</IonGrid>
There are many ways to do that, for example in the .scss file add:
ion-grid {
height: 120px;
ion-row{
height: 20px;
}
ion-col {
border: 0.3px solid #f4f4f4;
}
}
And also "extra style":
ion-row.myHeight{
height: 40px;
}
Related
i am trying to make the segments on ios look the same way as they look on android. refer https://beta.ionicframework.com/docs/api/segment
i tried to play with the css properties like
segment-button-checked {
--background-checked: transparent !important;
--color-checked: white !important;
border-bottom: 1 px solid white
}
ion-segment-button {
--color: #8CA2A5;
--border-color: transparent !important
}
selected button properties does not work this way. and overall visually does not look very nice as it looks on adroid
EDIT: Ionic 4 solution
Set the segment height to match header height
ion-segment{
height: 44px;
}
Style segment button with color for the un-active segment.
Remove border and border-radius.
ion-segment-button{
font-size: 16px;
color: var(--ion-color-medium);
border: 0px;
border-radius: 0px;
}
.segment-button-checked class is used to style active state of segment.
.segment-button-checked{
background: #FFF;
color: var(--ion-color-primary);
border-bottom: 3px solid var(--ion-color-primary);
}
Original segment button:
After styling:
This can easily done by setting mode as md
<ion-segment mode="md">
<ion-segment-button value="friends">
<ion-label>Friends</ion-label>
</ion-segment-button>
<ion-segment-button value="enemies">
<ion-label>Enemies</ion-label>
</ion-segment-button>
</ion-segment>
With ionic 4 an ion-label was added and so the best approach is to customize it like this
.segment-button {
ion-label {
color: var(--ion-color-medium);
}
}
.segment-button-checked {
ion-label {
color: var(--ion-color-light) !important;
}
}
this will work well!
For some reason, the address picker field won't fill the width 100% like the other fields, even though I've applied the same styling:
http://realendeavors.com/dmv-form/thank-you2.htm
Is there some other css controlling the width of the address field?
Add the below CSS code
span.twitter-typeahead {
border: 1px solid #a9a9a9;
width: 100%;
}
span.twitter-typeahead input {
border: none !important;
}
Add width:100%; to the span of the input field like this.
<span class="twitter-typeahead" style="position: relative; display: inline-block; direction: ltr; width:100%;">
First of all I have to say:
what a phantastic piece of software!
Well designed, implemented and documented, and many, many cool features.
Tanks a lot for giving that away as Open Source!
Now I have made a slider implementation for the "Gambio GX"-shopsystem (a very advanced osCommerce fork.)
You can see it here in action: http://marmorkamin-shop.de/Test/
I have used all image transformations (377) and caption animations (438) available, both are randomly selected for each slide...
(Resulting in 163,618(!) different ways to change slides....)
The slider is dynamically generated with PHP, based on slide-information in the shops database....
As inline-styles are very inflexible in such an environment, I have moved the styling to a stylesheet.
It already works like a charm, almost....
Two problems I am encountering:
The caption area is sometimes clipped
(see 1st caption in this picture: screenshot)
Only bullets 1, 2 and 3 in the bullet navigator are active, the others do not respond.
Any idea what could be the reason for this??
Thx again for this great software!
Edit:
The caption area is sometimes clipped (see 1st caption in this
picture: screenshot)
Found a quick and dirty solution for this meanwhile:
Assign a clip: auto !important; CSS direktice for the caption elements...
But I am sure there must be a better solution :-)
Re: caption clipped
Please always specify width and height for caption.
You can specify width and height in css file,
.slide_caption_1 {
left: 100px; top: 200px; width: 110px; height: 29px;
}
.slide_caption_2 {
left: 150px; top: 250px; width: 110px; height: 29px;
}
.slide_caption_3 {
left: 200px; top: 300px; width: 110px; height: 29px;
}
And you can specify inline style as well,
<div class="jssor_slide_caption slide_caption_1" data-u="caption" t="*" style="width: 110px; height: 30px;"></div>
Re: bullet problem
Style for 'mousedown' of bullet navigator not specified.
Given class of navigator item prototype is 'jssor_navigator_entry', the class name for 'active' state is 'jssor_navigator_entryav', the class name for 'mousedown' state is 'jssor_navigator_entrydn'
So, please add following css code in slideshow.css file.
.jssor_navigator_entrydn {
padding: 5px 0px 0px; border: currentColor; border-image: none; width: 27px; height: 24px; text-align: center; color: white !important; font-weight: bold !important; text-decoration: none; margin-right: 0px; float: left; display: block; position: relative !important; z-index: 9; cursor: pointer; background-color: rgb(50, 22, 1);
}
Here is an example to define bullet navigator in a simple way,
<script>
var jssor_options={
...
$BulletNavigatorOptions: { //[Optional] Options to specify and enable navigator or not
...
$SpacingX: 5, //[Optional] Horizontal space between each item in pixel, default value is 0
...
}
...
};
<script>
<!-- Bullet Navigator Begin -->
<style>
.the_navigator{
position: absolute;
bottom: 0px;
}
.the_navigator_item, .the_navigator_itemdn, .the_navigator_itemav {
position: absolute;
width: 27px;
height: 24px;
line-height: 24px;
color: #fff;
font-weight: bold;
background-color: #321601;
text-align: center;
cursor: pointer;
}
.the_navigator_item:hover, .the_navigator_itemav {
background-color: #d1013f;
}
</style>
<!-- bullet navigator container -->
<div class="the_navigator" data-u="navigator">
<!-- bullet navigator item prototype -->
<div class="the_navigator_item" data-u="prototype"><numbertemplate></numbertemplate></div>
</div>
<!-- Bullet Navigator End -->
I am using OpenCart 1.5.6 and a version of the YooResponsive theme.
When I am in my shopping cart and choose to Estimate Shipping, I add my state/zip and click the button and I get a popup box that is too small.
Both the right side and the bottom are cut off. The HTML code on the live site is:
<div id="colorbox" class="" style="padding-bottom: 57px; padding-right: 28px; top: 456px; left: 653px; position: absolute; overflow: hidden; width: 572px; height: 343px;">
If I use firebug to change width: 572px; height: 343px; to width: 600px; height: 400px; it looks correct but I can't seem to find anywhere in the code to make these changes.
This looks like it is hard coded rather than brought in from a css file.
In my cart.tpl I have the following javascript code:
$.colorbox({
overlayClose: true,
opacity: 0.5,
width: '600px',
height: '400px',
href: false,
html: html
});
This code seems to be setup right but why is it not displaying at the correct size?
It also does this with the Terms and Conditions link that shows up at the end of the checkout process. I imagine that if I check other pop-up boxes it would do the same.
One thing I noticed was that for both pop-up boxes (which are different sizes) the measurements that change are exactly the same as the padding in the HTML code (padding-bottom: 57px; padding-right: 28px;). So the height is always 57px smaller and the width is always 28px smaller. If I use firefox to change the padding in the HTML code above it does nothing to make it display correctly, only by changing the height and width does anything change.
Any help would be much appreciated.
Nevermind, I got it! I had a stylesheet attached to the site that was changing the box-sizing
The code was:
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
And I just added this code to the stylesheet.css to override it:
#colorbox {
-webkit-box-sizing: content-box !important;
-moz-box-sizing: content-box !important;
box-sizing: content-box !important;
}
I want to make a 100% width div in a 300px container, how is it posible? tryed postiton relative and absoulte with no success.
.container { margin:0 auto; text-align:center; background-color:black; width: 300px;}
.normalOne { background-color:grey; height: 50px;}
.hundredProcent { background-color:blue; height: 50px; width:100%;}
.normalTwo { background-color:red; height: 50px;}
<div class="container">
<div class="normalOne"></div>
<div class="hundredProcent"></div>
<div class="normalTwo"></div>
</div>
And here is a fiddle http://jsfiddle.net/lamberta/2U893/
I've added one addition div inside div.hundredProcent with following style:
style='position:absolute; background-color:yellow; height: 50px; width:100%;left:0px;'
Check this updated fiddle. You should not set position:relative to .container or
.hundredProcent div's
You can't do that by CSS alone. Use Javascript; something like this
document.getElementsByClassName('hundredProcent')[0].style.width =
document.body.clientWidth+'px';
for instance in the onload handler.
Make sure it works on all browsers that you need it to work on. I'm not even sure if getElementsByClassName is implemented in all modern browsers, so you may need to give the div an id to positively identify it.