Jump to content
  • 0

Врестка квадрата и заголовка


Akkord87
 Share

Question

Здравствуйте!

Помоги пожалуйста решить проблему с небольшим куском верстки :)

Пример на картинке.

Я не могу понять, как свертать так, чтобы правая часть границы квадрата не перекрывала заголовок. При этом если заголовок из 1,2,3 строк то квадрат так же подстраивается и растягивается по высоте.

Есть у кого идеи, как можно это реализовать?

verstka.jpg

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

Как вариант:

<div class="wrap">
  Наука
  <div class="square">
    <div class="text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt obcaecati rem quasi saepe tenetur illo exercitationem dicta explicabo laudantium cumque, expedita voluptate repudiandae perspiciatis culpa suscipit? Necessitatibus nisi qui quaerat!
    </div>  
  </div>
</div>
.square{
  position: relative;
  border-left: 1px solid #000;
}
.square:before, .square:after{
    content: '';
  position: absolute;
  width: 100px;
  height: 1px;
  background: #000;
  left: 0;
}
.square:before{
  top: 0;
}
.square:after{
  bottom: 0;
}
.text{
  position: relative;
  padding: 30px 0 30px 20px;
}
.text:before, .text:after{
  content: '';
  position: absolute;
  height: 20px;
  width: 1px;
  background: #000;
  left: 100px;
}
.text:before{
  top: 0;
}
.text:after{
  bottom: 0px;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy