P. Zietal
P. Zietal

Reputation: 324

Can not put text over an image

I am trying to put text over an image, but when I give the text parametr left: it's cut in half.

HTML:

<div class="c-subcat-item">
  <div class="pro-img-wrap">
    <div class="pro-img-wrap-in">
      <div class="img-middle-center">
        <a class="img-middle-wrap" href="/Wines/Product/1417">
          <img src="/Images/bottle-red.jpg" alt="Produkt">
        </a>
      </div>
    </div>
  </div>

  <div class="subcat-item-details">
    <div class="product-desc-container">
      <div class="">
        <a class="item-name" href="/Wines/Product/1417">Avilla</a>
        <div class="clearfix"></div>
        <div class="item-our-price">
          <span class="item-sold-out">Chwilowo niedostępny</span>
        </div>
        <div class="item-detail-price">
          <span class="item-price-value">45,00 zł </span>
        </div>
      </div>
      <div class="div-empty-margin"></div>
    </div>
    <div class="clearfix"></div>
    <span class="item-more">
      <a class="item-more" href="/Wines/Product/1417">Zobacz więcej</a>
    </span>
    <div class="div-empty-margin"></div>
    <div class="add-to-cart">
    </div>
  </div>
</div>

CSS:

body {
    background-color: #fffff7;
    color: #666;
    font-family: 'Roboto Condensed',sans-serif;
    font-size: 10px;
    height: 100%;
  margin: 0;}
html, body, .page-wrapper {
    width: 100%;
    min-width: 1024px;
    margin-left: auto;
  margin-right: auto;}
.page-wrapper {
    height: 100%;
}
.page-content-wrapper {
    min-height: 100%;
    text-align: center;
}
.main {
    display: inline-block;
    margin: 20px auto 0;
    margin-bottom: 61px;
    position: relative;
    text-align: left;
    width: 965px;
}
.wrapper {
    float: left;
    margin-bottom: 20px;
    width: 100%;
}
.content {
    float: left;
    width: 100%;
}
.content-main-wrapper1 {
    float: left;
    width: 100%;
}
.content-main-wrapper2 {
    float: left;
    position: relative;
    right: 767px;
    width: 100%;
}
.content-wo-padding {
    float: left;
    left: 768px;
    position: relative;
    width: 726px;
}
.pro-img-wrap {
    float: left;
}

.c-subcat-item {
    float: left;
    padding: 20px;
    position: relative;
    width: 726px;
}
.pro-img-wrap-in {
    border: 1px solid #e8e5e5;
    float: left;
    height: 240px;
    overflow: hidden;
    width: 160px;
    display: table;
}
.img-middle-center {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    background: #fff;
    display: table-cell;
    float: none;
    height: 100%;
    width: 100%;
    text-align: center;
    vertical-align: middle;
}
.subcat-item-details {
    float: right;
    height: 242px;
    width: 544px;
    position: relative;
}
.product-desc-container {
    overflow: hidden;
    position: relative;
}
h2.item-name, a.item-name {
    color: #333;
    float: left;
    font-size: 16px;
    font-weight: bold;
    line-height: 15px;
    margin: 2px 0 5px 0;
    padding: 0;
    width: 100%;
    text-transform: uppercase;
}
.clearfix {
    clear: both;
}
.item-our-price {
    float: left;
    margin-top: 10px;
    width: 100%;
}
.item-our-price span.item-sold-out {
    position: relative;
    color: #f00;
    background-color: #fff;
    padding: 10px;
    border: solid 1px #f00;
    font-size: 1.3em;
    cursor: default;
  left: -60px;
}

You can check it here

Upvotes: 0

Views: 63

Answers (3)

Mihai T
Mihai T

Reputation: 17687

remove overflow:hidden from .product-desc-container

see here : jsfiddle

code

.product-desc-container {
/* overflow: hidden; */
position: relative;
}

Upvotes: 0

bubesh
bubesh

Reputation: 426

Remove overflow:hidden from .product-desc-container that's the reason for the text not visible over the image

Upvotes: 0

Rohit
Rohit

Reputation: 1812

Remove overflow: hidden; from class .product-desc-container

body {
    background-color: #fffff7;
    color: #666;
    font-family: 'Roboto Condensed',sans-serif;
    font-size: 10px;
    height: 100%;
  margin: 0;}
html, body, .page-wrapper {
    width: 100%;
    min-width: 1024px;
    margin-left: auto;
  margin-right: auto;}
.page-wrapper {
    height: 100%;
}
.page-content-wrapper {
    min-height: 100%;
    text-align: center;
}
.main {
    display: inline-block;
    margin: 20px auto 0;
    margin-bottom: 61px;
    position: relative;
    text-align: left;
    width: 965px;
}
.wrapper {
    float: left;
    margin-bottom: 20px;
    width: 100%;
}
.content {
    float: left;
    width: 100%;
}
.content-main-wrapper1 {
    float: left;
    width: 100%;
}
.content-main-wrapper2 {
    float: left;
    position: relative;
    right: 767px;
    width: 100%;
}
.content-wo-padding {
    float: left;
    left: 768px;
    position: relative;
    width: 726px;
}
.pro-img-wrap {
    float: left;
}

.c-subcat-item {
    float: left;
    padding: 20px;
    position: relative;
    width: 726px;
}
.pro-img-wrap-in {
    border: 1px solid #e8e5e5;
    float: left;
    height: 240px;
    overflow: hidden;
    width: 160px;
    display: table;
}
.img-middle-center {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    background: #fff;
    display: table-cell;
    float: none;
    height: 100%;
    width: 100%;
    text-align: center;
    vertical-align: middle;
}
.subcat-item-details {
    float: right;
    height: 242px;
    width: 544px;
    position: relative;
}
.product-desc-container {
    
    position: relative;
}
h2.item-name, a.item-name {
    color: #333;
    float: left;
    font-size: 16px;
    font-weight: bold;
    line-height: 15px;
    margin: 2px 0 5px 0;
    padding: 0;
    width: 100%;
    text-transform: uppercase;
}
.clearfix {
    clear: both;
}
.item-our-price {
    float: left;
    margin-top: 10px;
    width: 100%;
}
.item-our-price span.item-sold-out {
    position: relative;
    color: #f00;
    background-color: #fff;
    padding: 10px;
    border: solid 1px #f00;
    font-size: 1.3em;
    cursor: default;
  left: -60px;
}
<div class="c-subcat-item">
  <div class="pro-img-wrap">
    <div class="pro-img-wrap-in">
      <div class="img-middle-center">
        <a class="img-middle-wrap" href="/Wines/Product/1417">                      <img src="/Images/bottle-red.jpg" alt="Produkt">
        </a>
      </div>
    </div>
  </div>

  <div class="subcat-item-details">
    <div class="product-desc-container">
      <div class="">
        <a class="item-name" href="/Wines/Product/1417">Avilla</a>
        <div class="clearfix"></div>
        <div class="item-our-price">
          <span class="item-sold-out">Chwilowo niedostępny</span>
        </div>
        <div class="item-detail-price">
          <span class="item-price-value">45,00 zł </span>
        </div>
      </div>
      <div class="div-empty-margin"></div>
    </div>
    <div class="clearfix"></div>
    <span class="item-more">
      <a class="item-more" href="/Wines/Product/1417">Zobacz więcej</a>
    </span>
    <div class="div-empty-margin"></div>
    <div class="add-to-cart">
    </div>
  </div>
</div>

Upvotes: 1

Related Questions