3

I know my question is quite similar to other people, but the case is different.

This is how it shown in Chrome enter image description here

Safari enter image description here

You can see the map disappears in safari. I have tried some methods including min-height in percentage but not working.

Take note: I want to make the image and text columns have same height, the size will be changed according to screen size, so please don't suggest a fix width and height for me.

Hoping that some of you could provide me with some advice. Thanks!

$('#tabs').tabs({
    activate: function (event, ui) {}
});
* {margin:0;padding:0;box-sizing:border-box}
html, body {width:100%}

#Contact, #contact-panel{ height: 92%;}

.fullwidth_contact{
  display: flex;
  display: -moz-box;
  display: -webkit-flexbox;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: -moz-flex;
  flex-direction: row;
  -webkit-flex-direction: row;
  -moz-flex-direction: row;
  -ms-flex-direction: row;
  height: 92%;
  margin: 0;
  padding:0;
}

.rowdisplay_contact {
  display: flex;
  display: -moz-box;
  display: -webkit-flexbox;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: -moz-flex;
  flex-direction: column;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  -ms-flex-direction: column;
  height: 90%;
  margin: 0;
  padding:0;
}


.repeat-xcontact {
  flex: 1;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

.width70{flex-basis: 70%;}
.width30{flex-basis: 30%;}

.country_box{ 
 font-size: 25px;
 line-height: 1.2em;
 padding: 12% 10%;
 background-color: #5ba4ee;
}

.address_box{
 padding: 12% 10%;
 background-color: #ccc;
}

.map { background-image: url("http://geology.com/world/world-map.gif");}

ul.tabs{
 margin:0;
 padding: 16% 0 0 0;
    list-style-type: none;
}

ul.tabs li{
 padding: 5px 0;
}

ul.tabs li a{
 color: #fff;
 font-weight: bold;
}

ul.tabs li a:hover, .ui-state-active{
 font-weight: bold;
 color: #1d70c4;
 outline:none;
}

.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
 font-weight: bold;
 color: #1d70c4;
 text-decoration: none;
}

ul.tabs li a:focus {
    outline:none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<div id="tabs" class="fullwidth_contact">
  <div class="repeat-xcontact map width70"></div>
  
  <div class="repeat-xcontact width30">
 <!-- <div class="rowdisplay_contact width100"> -->
   <div class="repeat-xcontact country_box">
  <div class="txt8">CONTACT</div><br/>
  <ul class="tabs" data-persist="true">
   <li><a href="#view1">Content 1</a></li>
   <li><a href="#view2">Content 2</a></li>
   <li><a href="#view3">Content 3</a></li>
  </ul>
   </div>
   <div class="repeat-xcontact address_box">
  <div id="view1">
   <p class="country_title">Content 1</p>
   <p>Cras dignissim lectus sed dui ullamcorper, et suscipit justo vehicula.</p>
   <p>T &nbsp;&nbsp; 1234 5678</p>
   <p>F &nbsp;&nbsp; 1234 5678</p>
   <p>E &nbsp;&nbsp; <script language="JavaScript"><!--
   var name = "info";
   var domain = "test.com";
   document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
   document.write(name + '@' + domain + '</a>');
   // --><!--</script></p>
  </div>
  <div id="view2">
   <p class="country_title">Content 2</p>
   <p>Cras dignissim lectus sed dui ullamcorper, et suscipit justo vehicula.</p>
   <p>T &nbsp;&nbsp; 1234 5678</p>
   <p>F &nbsp;&nbsp; 1234 5678</p>
   <p>E &nbsp;&nbsp; <script language="JavaScript"><!--
   var name = "info";
   var domain = "test.com";
   document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
   document.write(name + '@' + domain + '</a>');
   // --><!--</script></p>
  </div>
  <div id="view3">
   <p class="country_title">Content 3</p>
   <p>Cras dignissim lectus sed dui ullamcorper, et suscipit justo vehicula.</p>
   <p>T &nbsp;&nbsp; 1234 5678</p>
   <p>F &nbsp;&nbsp; 1234 5678</p>
   <p>E &nbsp;&nbsp; <script language="JavaScript"><!--
   var name = "info";
   var domain = "test.com";
   document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
   document.write(name + '@' + domain + '</a>');
   // --><!--</script></p>
  </div>
   </div>
 <!-- </div> -->
  </div>
</div>
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Evelyn
  • 656
  • 7
  • 29

1 Answers1

1

I just tested your snippet on Safari (v11.0.2), Chrome (v63.0.3239.132) and FireFox (v57.0.4) and it seems to work on all of them.

Snippet test in Safari

I also made a codepen to test your problem: https://codepen.io/mike-scheurwater/pen/zpWxOO

Can you tell me if it works and if not, what version(s) are you using?

$('#tabs').tabs({
    activate: function (event, ui) {}
});
* {margin:0;padding:0;box-sizing:border-box}
html, body {width:100%}

#Contact, #contact-panel{ height: 92%;}

.fullwidth_contact{
  display: flex;
  display: -moz-box;
  display: -webkit-flexbox;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: -moz-flex;
  flex-direction: row;
  -webkit-flex-direction: row;
  -moz-flex-direction: row;
  -ms-flex-direction: row;
  height: 92%;
  margin: 0;
  padding:0;
}

.rowdisplay_contact {
  display: flex;
  display: -moz-box;
  display: -webkit-flexbox;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: -moz-flex;
  flex-direction: column;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  -ms-flex-direction: column;
  height: 90%;
  margin: 0;
  padding:0;
}


.repeat-xcontact {
  flex: 1;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

.width70{flex-basis: 70%;}
.width30{flex-basis: 30%;}

.country_box{ 
 font-size: 25px;
 line-height: 1.2em;
 padding: 12% 10%;
 background-color: #5ba4ee;
}

.address_box{
 padding: 12% 10%;
 background-color: #ccc;
}

.map { background-image: url("http://geology.com/world/world-map.gif");}

ul.tabs{
 margin:0;
 padding: 16% 0 0 0;
    list-style-type: none;
}

ul.tabs li{
 padding: 5px 0;
}

ul.tabs li a{
 color: #fff;
 font-weight: bold;
}

ul.tabs li a:hover, .ui-state-active{
 font-weight: bold;
 color: #1d70c4;
 outline:none;
}

.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
 font-weight: bold;
 color: #1d70c4;
 text-decoration: none;
}

ul.tabs li a:focus {
    outline:none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<div id="tabs" class="fullwidth_contact">
  <div class="repeat-xcontact map width70"></div>
  
  <div class="repeat-xcontact width30">
 <!-- <div class="rowdisplay_contact width100"> -->
   <div class="repeat-xcontact country_box">
  <div class="txt8">CONTACT</div><br/>
  <ul class="tabs" data-persist="true">
   <li><a href="#view1">Content 1</a></li>
   <li><a href="#view2">Content 2</a></li>
   <li><a href="#view3">Content 3</a></li>
  </ul>
   </div>
   <div class="repeat-xcontact address_box">
  <div id="view1">
   <p class="country_title">Content 1</p>
   <p>Cras dignissim lectus sed dui ullamcorper, et suscipit justo vehicula.</p>
   <p>T &nbsp;&nbsp; 1234 5678</p>
   <p>F &nbsp;&nbsp; 1234 5678</p>
   <p>E &nbsp;&nbsp; <script language="JavaScript"><!--
   var name = "info";
   var domain = "test.com";
   document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
   document.write(name + '@' + domain + '</a>');
   // --><!--</script></p>
  </div>
  <div id="view2">
   <p class="country_title">Content 2</p>
   <p>Cras dignissim lectus sed dui ullamcorper, et suscipit justo vehicula.</p>
   <p>T &nbsp;&nbsp; 1234 5678</p>
   <p>F &nbsp;&nbsp; 1234 5678</p>
   <p>E &nbsp;&nbsp; <script language="JavaScript"><!--
   var name = "info";
   var domain = "test.com";
   document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
   document.write(name + '@' + domain + '</a>');
   // --><!--</script></p>
  </div>
  <div id="view3">
   <p class="country_title">Content 3</p>
   <p>Cras dignissim lectus sed dui ullamcorper, et suscipit justo vehicula.</p>
   <p>T &nbsp;&nbsp; 1234 5678</p>
   <p>F &nbsp;&nbsp; 1234 5678</p>
   <p>E &nbsp;&nbsp; <script language="JavaScript"><!--
   var name = "info";
   var domain = "test.com";
   document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
   document.write(name + '@' + domain + '</a>');
   // --><!--</script></p>
  </div>
   </div>
 <!-- </div> -->
  </div>
</div>
  • I copied your snippet because i need to add code when adding a codepen-link. – M. Scheurwater Jan 10 '18 at 08:25
  • I'm using Mac safari 5.1.10 and windows safari 5.1.7. Both got the same issue. Do you have any solution? I have been struggling with it for a few days :( – Evelyn Jan 10 '18 at 09:35
  • I'm using the same settings as you do, but it works here. – roberrrt-s Jan 10 '18 at 10:06
  • oh man, I think my windows and mac are too old till I can only get old version of safari. Will try on windows 10 later. Thanks for reminding me! – Evelyn Jan 10 '18 at 11:21
  • 1
    If you check this site (https://caniuse.com/#search=flex) you can see that Safari 5.1 does not support Display:flex; So that is the problem :) – M. Scheurwater Jan 10 '18 at 12:56
  • yesterday I tried in windows 10, the result is still same :(, I think I need to find some solutions to solve it. Do you have any suggestion? – Evelyn Jan 11 '18 at 03:25
  • 1
    If display: flex; doesn't work, you can use `display: table;` on #tabs and `display:table-cell; width: 70%;` on .repeat-xcontact. You can always check [modernizer](https://modernizr.com/docs/#flexbox) for the fallbacks. – M. Scheurwater Jan 11 '18 at 07:54
  • If this is the answer you were looking for, could you put the question as solved and set my answer as the right one? – M. Scheurwater Jan 12 '18 at 14:07