Responsive HTML for border around logo image - html

I need to make responsive layout of the design attached , please help.
Things to keep in mind:
Can't fix height/width of logo image or any of the div's, it has to be dynamic
5px padding between the border line and the image.
Thanks!
.width100per {
max-width:1100px;
width:100%;
height:1000px;
text-align:center;
margin: 0px auto;
background-color: #808080;
}
.container {
width:100%;
float:left;
}
.container::after {
content: " ";
border-bottom:red 2px solid;
width: 100%;
float: left;
position: absolute;
top: 24%;
left: 0;
z-index: 10;
}
header {
float: left;
width: 100%;
}
header .logo {
float:left;
width:20%;
height:100%;
background-color:#000;
position: relative;
z-index: 20;
}
header .logo img{
width: 100%;
}
<div class="width100per">
<div class="container"></div>
<header>
<div class="logo">
<img src="jessicarose.nordicfinest.com/static/home_333333.png">
</div>
</header>
</div>

add this code in your css
header:after{
content: " ";
border-bottom: red 2px solid;
width: 100%;
float: left;
position: absolute;
bottom: -2px;
left: 0;
z-index: 10;
}
header{
position:relative;
}
.container::after {
display:none;
}

<div class="width100per">
<header>
<div class="logo">
<img src="jessicarose.nordicfinest.com/static/home_333333.png">
</div>
</header>
</div>
/* Css */
header {
float: left;
width: 100%;
padding-left: 20%;
position: relative;
}
header .logo {
float:left;
width:20%;
height:calc(100% + 10px);
height:-moz-calc(100% + 10px);
height:-webkit-calc(100% + 10px);
background-color:#000;
position: absolute;
background-color:#000;
padding: 5px;
z-index: 20;
top: 0;
left: 0;
text-align: center;
}
header .logo img{
padding-top: 20px;
display:inline-block;
float: none;
max-width: 100%;
}

Related

How to align bottom block?

I need to make template as it shown on picture below:
I succed with top square but failed with alligning the bottom one - can't move it to the bottom left corner.
The code is:
<style>
.red_top {
background-color:red;
position:absolute;
width:65px;
height:65px;
z-index:-1;
}
.red_bottom {
align:right;
verical-align:bottom;
background-color:red;
position:relative;
width:65px;
height:65px;
z-index:-1;
top:-35px;}
.main_cont
{
border:1px solid blue;
margin-top:25px;
margin-left:25px;
min-height:100px;
z-index:1;
background-color:#FFF;
}
</style>
<body style="margin: 60px 50px;">
<div style="width:100%; border:1px solid #000;">
<div class="red_top"> </div>
<div class="main_cont">Content Here</div>
<div class="red_bottom"> </div>
</div>
https://codepen.io/anon/pen/OxavGL
What I need to do for red_bottom div proper placing?
.red_top {
background-color: red;
position: absolute;
width: 65px;
height: 65px;
z-index: -1;
}
.red_bottom {
background-color: red;
position: absolute;
width: 65px;
height: 65px;
z-index: -1;
bottom: 0;
right: 0;
}
.main_cont {
border: 1px solid blue;
margin: 25px;
min-height: 100px;
z-index: 1;
background-color: #FFF;
}
<div style="width: 100%; border: 1px solid #aaa; position: relative;">
<div class="red_top"> </div>
<div class="main_cont">Content Here</div>
<div class="red_bottom"> </div>
</div>
body {
margin: 60px 50px;
}
.Wrap {
position: relative;
width: 100%;
}
.main_cont {
position: relative;
background-color: #FFF;
border: 1px solid blue;
margin-top: 25px;
margin-left: 25px;
min-height: 100px;
}
.main_cont::before,
.main_cont::after {
content: "";
position: absolute;
background-color: red;
width: 65px;
height: 65px;
z-index: -1;
}
.main_cont::before {
top: -33px;
left: -33px;
}
.main_cont::after {
bottom: -33px;
right: -33px;
}
<div class="Wrap">
<div class="main_cont">Content Here</div>
</div>
Try This:
body {
margin: 5%;
}
.Wrap {
position: relative;
width: 100%;
}
.main_cont {
position: relative;
background-color: #FFF;
border: 1px solid blue;
min-height: 100px;
text-align: center;
}
.main_cont::before,
.main_cont::after {
content: "";
position: absolute;
background-color: red;
width: 50px;
height: 50px;
z-index: -1;
}
.main_cont::before {
top: -25%;
left: -3%;
}
.main_cont::after {
bottom: -25%;
right: -3%;
}
<div class="Wrap">
<div class="main_cont">Content Here</div>
</div>
CSS:
.main_cont::before {
content: '';
background-color: red;
position: absolute;
width: 65px;
height: 65px;
z-index: -1;
top: 0;
left: 0;
}
.main_cont::after {
content: '';
background-color: red;
position: absolute;
width: 65px;
height: 65px;
z-index: -1;
bottom: 0;
right: 0;
}
.main_cont {
border: 1px solid blue;
margin: 25px;
min-height: 100px;
z-index: 1;
background-color: #FFF;
}
HTML:
<div style="width: 100%; border: 1px solid #000; position: relative;">
<div class="main_cont">Content Here</div>
</div>
Here you go:
.mainDiv {
position: relative;
width: 500px;
height: 700px;
border: 1px solid black;
background-color: white;
}
.red_top {
background-color:red;
position:absolute;
left: -31px;
top: -31px;
width:65px;
height:65px;
z-index:-1;
}
.red_bottom {
background-color:red;
position:absolute;
bottom: -31px;
right: -31px;
width:65px;
height:65px;
z-index:-1;
.main_cont {
border:1px solid blue;
margin-top:25px;
margin-left:25px;
min-height:100px;
z-index:1;
background-color:#FFF;
}
<body style="margin: 60px 50px;">
<div class="mainDiv">
<div class="red_top"></div>
<div class="main_cont">Content Here</div>
<div class="red_bottom"></div>
</div>
You can use the following solution without using additional <div> elements for the red boxes. This solution is using :before and :after to create the red boxes.
div.container {
border:1px solid #000;
position:relative;
width:100%;
}
div.main {
background:#fff;
border:1px solid blue;
margin:33px;
min-height:100px;
position:relative;
width:auto;
}
.red-box:before, .red-box:after {
background:red;
content:"";
height:65px;
position:absolute;
width:65px;
z-index:-1;
}
.red-box:before {
left:0;
top:0;
transform:translate(-50%, -50%);
}
.red-box:after {
bottom:0;
right:0;
transform:translate(50%, 50%);
}
<div class="container">
<div class="main red-box">Content Here</div>
</div>

How do I place divs on top of other divs?

I am trying to place my leftbody and rightbody over top of my MidBody but it doesnt seem to work. I thought placing the Midbody to relative and the left and right bodies to absolute with a z-index would help but it doesnt. So i am clueless right now. Any help would be greatly appreciated.
.Header {
background-color: #CCCCCC;
width: calc(100%-16px);
height: 100px;
border-radius: 5px;
}
.MidBody {
background-color: #141414;
width: calc(100%-16px);
height: 850px;
margin-top: 3px;
border-radius: 5px;
position: relative;
}
.footer {
background-color: #CCCCCC;
width: calc(100%-16px);
height: 50px;
margin-top: 5px;
border-radius: 5px;
}
#leftbody {
background-color: #F1F1F1;
width: calc(50%-16px);
height: 425px;
float: left;
margin-left: 3px;
position: absolute;
z-index: 1;
}
#rightbody {
background-color: #F1F1F1;
width: calc(50%-16px);
height: 425px;
float: right;
position: absolute;
z-index: 1;
}
<div class="Header"></div>
<div class="MidBody">
<div id="leftbody"></div>
<div id="rightbody"></div>
</div>
<div class="footer"></div>
I changed
float:left; -> left:0;
float:right; -> right:0;
and
width:calc(50%-16px); -> width:50%;
Final css :
.Header {
background-color:#CCCCCC;
width: calc(100%-16px);
height: 100px;
border-radius: 5px;
}
.MidBody {
background-color:#141414;
width: calc(100%-16px);
height: 850px;
margin-top:3px;
border-radius: 5px;
position: relative;
}
.footer {
background-color:#CCCCCC;
width:calc(100%-16px);
height: 50px;
margin-top: 5px;
border-radius: 5px;
}
#leftbody {
background-color:#F1F1F1;
width:50%;
height:425px;
left:0;
margin-left: 3px;
position: absolute;
z-index: 9999;
}
#rightbody {
background-color:#F1F1F1;
width:50%;
height:425px;
right:0;
position: absolute;
z-index: 9999;
}
<div class="Header"></div>
<div class="MidBody">
<div id="leftbody"></div>
<div id="rightbody"></div>
</div>
<div class="footer"></div>
Use position: fixed; instead of position: absolute;

Div Not Showing Properly

I am new to Asp.Net and CSS
i want div header fixed and Bottom left div fixed. And right side two div width based on percentage. So i tried like this
CSS
left: 0px;
position:fixed ;
z-index: 2;
border-bottom: 1px solid #00e5e6;
}
#DivLogo
{
height: 80Px;
width: 350px;
position:fixed;
margin-left: 20px;
margin-top: 10px;
border:1px solid #aaac62;
-webkit-border-radius:15px;
-moz-border-radius:15px;
border-color:Blue
}
#DivShow
{
height: 30Px;
width: 350px;
position:fixed;
float:left;
margin-left: 20px;
margin-top: 95px;
}
#DivRight
{ height: 70px;
width: 150px;
position:fixed;
left: 85%;
margin-top: 10px;
top: 0px;
}
#DivMenuRight
{
height: 30Px;
width: 500px;
position:fixed;
right:15%;
margin-top: 95px;
}
#DivBody
{
width: 100%;
height: 380px;
position: fixed;
margin-top: 155px;
margin-bottom: 20px;
top: 4px;
left: -2px;
margin-left: 0px;
margin-right: 0px;
}
#DivLeft
{
width: 200px;
height: 100%;
position: fixed;
float: left;
border-right: 1px solid #00e5e6;
}
#DivBodyRight
{
height: 100%;
position:absolute;
float: left;
right:0px;
left:200px;
top: 156px;
}
#DivVersion, #DivRelease, #DivUserAccount, #DivOther
{
width:70%;
height: 100%;
position:absolute;
float: left;
top:0px;
left:0px;
border-Right: 1px solid #00e5e6;
}
#grdVersions, #grdRelease, #grdUserAccount, #grdOther
{
width:100%;
height:100%;
}
#DivUserDetail
{
width: 30%;
height: 100%;
position:absolute;
float: right;
right:0px;
top:0px;
border-Left: 1px solid #00e5e6;
}
ASP.Net
<div id="DivMain">
<div id="DivHeader">
<div id="DivLogo">
</div>
<div id="DivShow">
</div>
<div id="DivRight">
</div>
<div id="DivMenuRight">
</div>
</div>
<div id="DivBody">
<div id="DivLeft">
</div>
<div id="DivBodyRight">
<div id="DivVersion" runat=server>
</div>
<div id="DivUserDetail">
</div>
</div>
</div>
</div>
Fiddle https://jsfiddle.net/fsp1vw2u/
Bottom right side div not showing properly. Its Start from middle.
What am doing wrong here?
am using visual studio 2008 and CSS 2.1
Change Position absolute to fixed
#DivBodyRight {
float: left;
height: 100%;
left: 200px;
position: fixed;
right: 0;
}
https://jsfiddle.net/fsp1vw2u/9/

Div in front of another div

I need move container of site IN FRONT OF another div with background.
This is how it should looks like(ignore all other elements, just notice the background and container) -
And this is how it looks now (wrong):
I was trying something with "position: absolute" and "top: x" and it "little works" but when i used magnifier in browser, it was completely scattered.
This is my actual code...
html:
<div class="horni-panel">
<div class="logo">
Zhlednuto.cz
</div>
<div class="menu">
Home, about atd.
</div>
</div>
<!-- Mini pozadi -->
<div class="minipozadi">
ahoj
</div>
<!-- hlavni obsah -->
<div class="container">
ahooj
</div>
and css:
#font-face
{
font-family: Lato-Bold;
src: url(fonts/Lato-Bold.ttf);
}
body
{
background-color: #34495e;
}
.horni-panel
{
border-top: 8px solid #34495e;
position:absolute;
top:0;
left:0;
right:0;
height: 77px;
width: 100%;
background-color: #ffffff;
}
.logo
{
color: #34495e;
font-family: Lato-Bold;
font-size: 33px;
}
.minipozadi
{
height: 282px;
width: 100%;
background-image: url(img/bg.jpg);
background-size: 100%;
background-repeat: no-repeat;
margin: 0 auto;
position:absolute;
top: 85px;
left:0;
right:0;
}
.container
{
z-index: -1;
margin: 0 auto;
top:0;
right:0;
left:0;
width: 70%;
height: 500px;
background-color: #ffffff;
border-radius: 5px;
}
I'm suspecting your looking for this
http://output.jsbin.com/puladizire/2/
.minipozadi
{
height: 282px;
width: 100%;
background:url(http://www.hdwallpapers.in/walls/abstract_color_background_picture_8016-wide.jpg);
background-size: 100%;
background-repeat: no-repeat;
margin: 0 auto;
position:absolute;
top: 85px;
left:0;
right:0;
z-index:1;
text-align:center;
font-size:30px;
}
.container
{
z-index: 100;
margin: 0 auto;
position:absolute;
top:0;
right:0;
left:0;
margin-top:200px;
width: 70%;
height: 400px;
background-color: #ffffff;
border-radius: 5px;
}
I have added margin and z-index to the container

How to expand the div to fill the width of any size in the middle column will be?

Demo jsFiddle
I have div color azure I want to fill the width area in the middle column no meter what size will be.
is there any solution with css3/css no jQuery ?
i need it like this picture:
the ststus current like this:
many Thx.
Demo jsFiddle
the code html:
<div id="frame">
<div id="inside_window">
<div id="Yellow"></div>
<div id="Green"></div>
<div id="Blue"></div>
<div id="Red"></div>
<div id="ver"></div>
<div id="hor"></div>
<div id="ver2"></div>
</div>
</div>
​
the code css:
html, body{
height:100%;
background-color: azure;
}
#frame
{
position: relative;
background-color: black;
height: 100%;
width: 100%;
margin: auto;
padding:0;
border: 1px solid black;
}
#Yellow
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: Yellow;
z-index:10;
display:table;
left:0px;
top:0;
}
#Green
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: green;
z-index:10;
right:0px;
top:0;
}
#Blue
{
position: relative;
height:100%;
min-width:65.8%;
-webkit-border-radius: 0px;
margin: 0 auto;
background-color: #62A9FF;
z-index:10;
display:table;
font-size:220%;
left:0px;
top:0px;
}
#Red
{
position: absolute;
height: 150px;
width: 100%;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: red;
z-index:10;
border: 1px solid black;
left:0px;
bottom:0px;
}
#inside_window
{
width:100%;
height:100%;
margin:0 auto;
position: relative;
border: 1px solid black;
background-color: brown;
-webkit-transform: rotate(0deg);
-webkit-transform-origin:50% 50%;
}
#ver
{
position: absolute;
height: 100%;
width: 5px;
margin: 0;
background-color: white;
left:150px;
top:0px;
z-index:1;
}
#hor
{
position: absolute;
height: 5px;
width: 100%;
margin: 0;
background-color: white;
left:0px;
bottom:150px;
z-index:20;
}
#ver2
{
position: absolute;
height: 100%;
width: 5px;
margin: 0;
background-color: white;
right:150px;
top:0px;
z-index:1;
}
​
Try removing the following CSS from your blue code:
position: relative;
display:table;
There are many ways to acheive a layout like this. Supposing that you could alter the order of your content, you could always try the "Holy Grail" layout method.