list elements disappearing in ie7 - css

you can see the website i'm currently working at here.
I know, it is VERY old styled but my customer designed it this way, and i'm just implementing it the way he wants... Don't worry, you won't be looking at it for too long!
The problem is that the navigation bar at the top disappear in internet explorer 7 (only 7) when the mouse is over it...
Exactly, all but the first element disappear. For some reason the first one stays... I cannot get any clue on what is happening, i'm sure there must be some kind of css trick i should use!
So here it is my css (only the one related to the navigation bar).
/*Relevant part*/
.navigation-menu-wrapper {
height: 143px;
max-height: 143px;
width: 829px;
}
.navigation-menu {
list-style: none;
}
.navigation-menu-item {
float: left;
background-color: rgba(255, 255, 255, 0.6);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#99FFFFFF', endColorstr='#99FFFFFF'); /*IE 7/8 fix for rgba*/
width: 163px;
height: 143px;
max-height: 143px;
font-family: "Times New Roman";
color: #000000;
text-transform: uppercase;
font-size: 24px;
line-height: 143px;
border: 1px solid #000000;
margin: 0;
padding:0;
}
.navigation-menu-item-selected {
background-color: rgba(255, 255, 255, 1);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#FFFFFFFF', endColorstr='#FFFFFFFF'); /*IE 7/8 fix for rgba*/
}
/*End relevant part*/
/*Page CSS, just in case you need it*/
.page-wrapper {
width: 1024px;
height: 100%;
max-height: 100%;
min-height: 768px;
}
.center-content-wrapper {
width: 824px;
min-height: 768px;
background-image: url("../../img/background.jpg");
background-repeat: no-repeat;
}
.main-content-wrapper {
width: 100%;
min-height: 623px;
max-height: 623px;
}
.main-content-overlay {
margin: 25px;
padding-left: 70px;
padding-right: 70px;
padding-top: 20px;
background-color: rgba(0, 0, 0, 0.85);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#d8000000', endColorstr='#d8000000');
min-height: 509px;
max-height: 509px;
height: 509px;
overflow-y: auto;
font-size: 14px;
font-family: "Times New Roman";
}
Can you suggest a fix? Even a dirty trick would be very much appreciated!
Thanks!

It's because you're wrapping your <a> around your list items .. it should be the other way around. Wrap your <li> around your <a>
So like this as an example:
<ul class="navigation-menu no-margin no-padding">
<li class="navigation-menu-item single-line"><a class="navigation-menu-item navigation-
menu-item-selected link-no-decoration" href="index.php">L'attivitá</a>
</li>
It works this way .. just do the same to all of your <li> and it will work in IE7

Your markups are messed up.
<ul class="navigation-menu no-margin no-padding">
<a class="navigation-menu-item navigation-menu-item-selected link-no-decoration" href="index.php">
<li class="navigation-menu-item single-line">L'at (...)
Element a not allowed as child of element ul in this context.

Related

Add arrows to dropdown menu CF7

I'm using Contact Form 7 on a website of a client, and I styled the dropdown menu to this:
.wpcf7-form select {
-webkit-appearance: textfield;
color: #72858a;
font-size: 0.7777777778rem;
background-color: #e9edf0;
border-color: #e9edf0;
padding-top: 5px;
padding-bottom: 5px;
}
Unfortunately the arrows are missing now. Is there anyway to add an down arrow at the right side of the dropdown menu in the same color as the text? I tried different css classes found on this website, but nothing seems to work.
Image of how it displays now:
And how it should be:
The arrow could also be another arrow.
Any help would be appreciated much!
Regards,
Vasco
Here's an option for you... now... I used the span.wpcf7-form-control-wrap that was specifically around the select I was styling. You could also (instead) wrap the selects in a custom div.
This produced this result for me
I also made the triangle using clip-path, so you can change the colors or anything else.
/* Using the menu-813 which for me was the span around the select.*/
span.wpcf7-form-control-wrap.menu-813 {
position: relative;
height: 60px;
background: #e9edf0;
display: inline-block;
}
span.wpcf7-form-control-wrap.menu-813:after {
content: '';
position:absolute;
width: 15px;
height: 15px;
background: #000;
right:8px;
top: 20px;
z-index: 0;
clip-path: polygon(100% 0, 0 0, 50% 100%);
}
.wpcf7-form select {
-webkit-appearance: none;
appearance: none;
color: #72858a;
font-size: 0.7777777778rem;
background-color: transparent;
border-color: #e9edf0;
padding-top: 5px;
padding-bottom: 5px;
width: 300px;
z-index: 1;
position: relative;
padding-left: 2ch;
}

Why Are Footer Styles Getting Cut Off?

I have some social media links in the footer here that are styled to be in circles: https://milfordpa.us
Everything looks good on Chrome, but on Safari, the last one appears to get "cut off" and I can't seem to figure out why.
Here is my current SCSS:
.social-links {
display: block;
float: right!important;
a {
border-radius: 50%;
padding: 10px 11px;
font-size: 20px;
background: $color3;
color: $color2;
margin-left: 5px;
&:hover {
background: $color4;
color: $color2!important;
}
}
i {
width: 21px!important;
height: 20px!important;
text-align: center;
}
}
Thank you in advance for your help!
In one of your parent elements for .social-link you're changing the width to something that safari seems to struggle with.
A quick fix is to reapply the width on .social-link
.social-link {
text-align: right;
min-width: -webkit-fill-available;
}

Align list items horizontally in adaptive design

Please see the JSFiddle.
This is an adaptive design with "vw" parameters in the code. I want Text_1, Text_2 and Text_3 be aligned horizontally, which means that when i change the browser's window size, the distance from the left side of the screen to the beginning of the text is the same for those 3 words. With the current code I align them (via "margin" property), but as soon as the browser's window size changes, Text_2 and Text_3 move relatively to Text_1 (to the right when window size dicreases, to the left when it increases). What is wrong in the code please?
<div class="meaning">
<ol class="circle">
<li>Text_1</li>
<ul>
<li><span class="example">Text_2</span></li>
<li><span class="example_translated">Text_3</span></li>
</ul>
</ol>
</div>
.meanings_and_examples {
display: flex;
flex-direction: column;
}
.meaning {
font-family: Tahoma, Geneva, sans-serif;
width: auto;
text-align: left;
color: #1f2c60;
font-weight: 700;
word-wrap: break-word;
text-shadow: 0.06em 0.06em 0.09em rgba(0, 0, 0, 0.2);
margin-right: 1%;
font-size: calc(0.5em + 2.3vw);
}
ol.circle {
list-style-type: none;
}
li {
line-height: calc(1.1em + 1.5vw);
}
ol.circle > li {
counter-increment: item;
margin: 0% 0% 0.2% 1.3em;
}
ol.circle > li::before {
content: counter(item);
display: inline-block;
text-align: center;
border-radius: 100%;
width: calc(1.2em + 1.5vw);
background: #1f2c60;
color: white;
box-shadow: 0.06em 0.06em 0.09em rgba(0, 0, 0, 0.2);
margin: 0% 3.5% 0% -2.4em;
}
ul {
list-style-type: none;
}
.example {
width: auto;
text-align: left;
font-weight: 400;
}
.example_translated {
width: auto;
text-align: left;
font-weight: 400;
color: #5d78e5;
}
Okay, you have a lot of things going on, for your next question I would strip the fiddle of any code that is not needed for the example, all styling and such.
Next you are using too many dynamic widths together and as Paulie_D said, you are not allowed to put anything other than li-tags in a ul-tag or ol-tag.
The main issue is that you have two lists, one within the other where the padding is very dynamic, I tried to change it so the padding matched the dynamic width of the bullet.
I kept your HTML and changed some CSS so it behaves like you want but you really should think of a new HTML setup.
.meanings_and_examples {
display: flex;
flex-direction: column;
}
.meaning {
font-family: Tahoma, Geneva, sans-serif;
width: auto;
text-align: left;
color: #1f2c60;
font-weight: 700;
word-wrap: break-word;
text-shadow: 0.06em 0.06em 0.09em rgba(0, 0, 0, 0.2);
margin-right: 1%;
font-size: calc(0.5em + 2.3vw);
}
ol.circle {
list-style-type: none;
border: 2px solid purple;
position: relative;
padding-left: 10vw;
}
li {
line-height: calc(1.1em + 1.5vw);
}
ol.circle > li {
counter-increment: item;
margin: 0% 0% 0.2% 0;
border: 2px solid orange;
padding: 0;
position: relative;
}
ol.circle > li::before {
content: counter(item);
display: inline-block;
text-align: center;
border-radius: 100%;
position: absolute;
background: #1f2c60;
color: white;
box-shadow: 0.06em 0.06em 0.09em rgba(0, 0, 0, 0.2);
width: calc(1.2em + 1.5vw);
transform: translateX(-100%);
}
ul {
list-style-type: none;
padding-left: 0;
border: 2px solid red;
}
.example {
width: auto;
text-align: left;
font-weight: 400;
}
.example_translated {
width: auto;
text-align: left;
font-weight: 400;
color: #5d78e5;
}
<div class="meaning">
<ol class="circle">
<li>Text_1</li>
<ul>
<li><span class="example">Text_2</span></li>
<li><span class="example_translated">Text_3</span></li>
</ul>
</ol>
</div>
See my modified fiddle for the behaviour you requested.
I'm not sure what is the point of inserting the ul in the ol. But I think if is not mandatory, you should use them separately since you are enumerating same type of elements from what I can see.
Then there are several problems with your margins: your conter has width: calc(1.2em + 1.5vw); but your margins are margin: 0% 3.5% 0% -2.4em; .
I am guessing this is accomplished by trying different values.
But your couter witch has width: calc(1.2em + 1.5vw); is pushing the first element out of the list.
So the margin should consider that if you want the list items to be aligned. So your counter should have the margins something like margin: 0% 3.5% 0% calc(-3.5% - 1.2em - 1.5vw);
I did a working example here . I am not sure if you want it exactly this way, but you can start from here.
But I have to ask:
Do you really need one and one or you just use them so you can add before some of the elements the counter? Because it might be better to just use a class (for the counter) and use a sigle list for all elements.

CSS fill parent width

I'm struggling to set the div width to the remaining width of the container div. In the example below I want the red div (an input) to take as much space as possible. If you enter anything in the input the green div appears, which should always be right aligned.
I don't want to use either flex nor display: table-* or workarounds like setting overflow: hidden for to make space for floats.
EDIT: I'm looking for any solution that works for IE10+ (including display: table-*, etc.)
Example: https://codesandbox.io/s/23xo3wjjrp (Change the template and style tag inside /components/SearchBox.vue for changes)
The example uses vue, but for completeness I post the code here too:
HTML
<div class="ms-Fabric ms-SearchBox" :class="searchBoxStyle">
<div class="ms-SearchBox-iconContainer">
<i class="ms-SearchBox-icon ms-Icon ms-Icon--Search"></i>
</div>
<input class="ms-SearchBox-field" type="text" placeholder="Search"
v-model="searchQuery" ref="input"
#blur="onBlur" #focus="onFocus">
<div class="ms-SearchBox-clearButton" v-show="searchQuery.length > 0"
#click="clear">
<i class="ms-SearchBox-icon ms-Icon ms-Icon--Clear"></i>
</div>
</div>
SCSS
// Active styles
.ms-SearchBox.is-active {
.ms-SearchBox-iconContainer {
width: 4px;
transition: width .167s;
.ms-SearchBox-icon {
opacity: 0;
}
}
}
// Static styles
.ms-SearchBox {
display: inline-block;
font-size: 0px;
font-weight: 400;
color: #333;
border: 1px solid #a6a6a6;
height: 32px;
padding-left: 8px;
width: 208px;
.ms-SearchBox-iconContainer {
font-size: 14px;
color: #106ebe;
transition: width .167s;
.ms-SearchBox-icon {
opacity: 1;
transition: opacity .167s 0s;
}
background: rgba(0, 0, 0, 0.2);
}
.ms-SearchBox-field {
display: inline-block;
font-size: 14px;
margin: 0;
padding: 0;
text-overflow: ellipsis;
overflow: hidden;
border: none;
outline: 1px solid transparent;
height: 32px;
vertical-align: top;
background: rgba(255, 0, 0, 0.2);
}
.ms-SearchBox-iconContainer,
.ms-SearchBox-clearButton {
display: inline-block;
height: 32px;
line-height: 32px;
width: 32px;
text-align: center;
}
.ms-SearchBox-clearButton {
font-size: 14px;
background: rgba(0, 255, 0, 0.2);
&:hover {
cursor: pointer;
}
}
}
You should try to set a width:100% to your input, and to set position:absolute to your icon containers. With paddings on the input, this should do the thing.
Hope I understood the question :)

How do you style the dropdown on Google Places Autocomplete API?

We need to tweak the styling of the dropdown that shows the autocomplete place suggestions when using the Google Places/Maps Autocomplete API.
Does anyone know if this is even possible? If so, I guess we just need to know the CSS classnames/IDs.
There's a screen grab of the bit I am referring to here:
This is now documented by google: https://developers.google.com/maps/documentation/javascript/places-autocomplete#style_autocomplete
If you use firebug (as mentioned in a comment to your question...) you see that the container with the autocomplete results is a DIV with the class "pac-container" and the suggestions are inside it as a DIV with the class "pac-item". so just style with CSS.
This CSS will allow the drop-down to resize to fit the width of the results:
.pac-container, .pac-item {
width: inherit !important;
}
It is pretty difficult to inspect the elements since it closes as soon as it loses focus.
Though we know that the container has the .pac-container class and items have .pac-item, upon further investigating the API I found that it embeds the CSS styles in the document.
Here's what initially there, so use it to change the pre-defined styles to fit your needs.
.pac-container {
background-color: #fff;
position: absolute!important;
z-index: 1000;
border-radius: 2px;
border-top: 1px solid #d9d9d9;
font-family: Arial, sans-serif;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden
}
.pac-logo:after {
content: "";
padding: 1px 1px 1px 0;
height: 16px;
text-align: right;
display: block;
background-image: url(https://maps.gstatic.com/mapfiles/api-3/images/powered-by-google-on-white3.png);
background-position: right;
background-repeat: no-repeat;
background-size: 120px 14px
}
.hdpi.pac-logo:after {
background-image: url(https://maps.gstatic.com/mapfiles/api-3/images/powered-by-google-on-white3_hdpi.png)
}
.pac-item {
cursor: default;
padding: 0 4px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
line-height: 30px;
text-align: left;
border-top: 1px solid #e6e6e6;
font-size: 11px;
color: #999
}
.pac-item:hover {
background-color: #fafafa
}
.pac-item-selected,
.pac-item-selected:hover {
background-color: #ebf2fe
}
.pac-matched {
font-weight: 700
}
.pac-item-query {
font-size: 13px;
padding-right: 3px;
color: #000
}
.pac-icon {
width: 15px;
height: 20px;
margin-right: 7px;
margin-top: 6px;
display: inline-block;
vertical-align: top;
background-image: url(https://maps.gstatic.com/mapfiles/api-3/images/autocomplete-icons.png);
background-size: 34px
}
.hdpi .pac-icon {
background-image: url(https://maps.gstatic.com/mapfiles/api-3/images/autocomplete-icons_hdpi.png)
}
.pac-icon-search {
background-position: -1px -1px
}
.pac-item-selected .pac-icon-search {
background-position: -18px -1px
}
.pac-icon-marker {
background-position: -1px -161px
}
.pac-item-selected .pac-icon-marker {
background-position: -18px -161px
}
.pac-placeholder {
color: gray
}
I case anyone is interested in the hierarchy I was able to scrape the following using Firebug:
<div class="pac-container pac-logo" style="width: 557px; position: absolute; left: 66px; top: 106px; display: none;">
<div class="pac-item">
<span class="pac-icon pac-icon-marker"></span>
<span class="pac-item-query">
<span>France</span>
</span>
</div>
<div>
This worked for me, and now I can run this on mobile!
.pac-container {
z-index: 10000 !important;
width: auto !important;
position: initial !important;
left: 0 !important;
right: 0 !important;
display: block !important;
}
.pac-container:empty{
display: none !important;
}
And this somewhere!
$('selector').append('.pac-container');
Now the results will show in the selected div as a normal block element :)
To force the box to stay open for much easier styling and inspection from dev tools you can set the input value from the JS console and the container will stay open when inspecting from the dev tools.
Simply run document.querySelector('.pac-target-input').value = 'CB' in the console on your page with the input, then go back to the Elements tab and you can now individually inspect each element.
This gets around the issue where it always closes when focus is lost.
if you want to create your custom html & css then AutocompleteService class is also available which will provide all data in json.
const service = new google.maps.places.AutocompleteService();
service.getQueryPredictions(
{ input: "provide location string here for search" },
(suggestions) => console.log(suggestions)
);
For easier debugging and styling. to keep the dropdown open.
use the following code in chrome console.
document.querySelector('.pac-container').style.display = 'block'
Also used following classes to style the suggested dropdown in google places auto complete
Update icons
.pac-icon {
background-image: url('./assets/locationMark.svg') !important;
background-repeat: no-repeat;
background-position: 0 0;
background-size: 14px 18px;
}
Update text
.pac-item-query {
font-size: 16px
}
Hide google logo
.pac-logo {
padding: 10px 0;
&::after {
display: none;
}
}

Resources