border radius of a div inside another div is overlapping - html

I am making this card using React, HTML and CSS
Here is my Code:
<div className="plan">
<div className="plan-name">
<h5>BASIC</h5>
</div>
<div className="plan-price">
<h2>$ 6.99</h2>
<span>Screen Availabilty Simultaneously</span>
</div>
<div className="plan-details">
<ul>
<li>
<span>
<CheckIcon />
</span>
Access to All Library in Unlimited
</li>
<li>New Content Monthly</li>
<li>Available on PC, Smartphones and tablet</li>
<li>Drawing in Color</li>
<li>Color in Very High Quality</li>
<li>Canceable at Any Time</li>
</ul>
</div>
</div>
CSS:
.plan {
border-radius: 25px;
overflow: hidden;
background-color: #fff;
}
.plan-name {
background-color: #3e104f;
padding: 25px 0;
border-style: solid;
border-width: 0;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
}
.plan-price {
color: #3e104f;
background-color: #fff;
padding: 35px 0;
}
.plan-details {
background-color: #3e104f;
height: 100%;
border-radius: 20px;
}
Output:
But I am getting the white border which I have highlighted above, on all corners. Can anyone tell me where am I doing wrong? Or from where it is coming? How do I hide it?

It's normal behavior, you have no mistake in your CSS.
Possible solution is to make something like this
.plan {margin-top: 25px; overflow: visible;} /* here just remove overflow: hidden to show .plan-name outside of .plan */
.plan-name {margin-top: -25px; border-top-right-radius: 25px; border-top-left-radius: 25px;}
Using this code .plan's radius is hidden underneath .plan-name and isn't visible in corners.

just adding .plan {overflow: auto;} works for me as well

Related

How to remove extra to the right of the input button?

Ok I'm recreating a PSD I found online for practise. In the header there is a search bar and button. To the right of the button there is extra content taking up space, which I can't get rid of.
I have added a jsfiddle
https://jsfiddle.net/jb7j6ysz/
Please ensure the preview is expanded to the left as much as possible
<!DOCTYPE html>
<html>
<head>
<title>Education Compaony</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header">
<div class="branding">
<h2>Education Department</h2>
<h5>A free PSD template</h5>
</div> <!-- /.Branding -->
<div class="directory">
<div class="search">
<input type="text">
<input type="submit" value="Search">
</div> <!-- /.Search -->
<div class="index">
<ul>
<li>A - Z index | </li>
<li>Studenet Login | </li>
<li>Staff Login </li>
</ul>
</div> <!-- /.Index -->
</div> <!-- /.Directory -->
</div> <!-- /.Header -->
</body>
</html>
/* Font Import */
#import url('https://fonts.googleapis.com/css?family=Lora');
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
}
.header{
height: 95px;;
background-color: #FCD05D;
color: #3A302E;
font-family: 'Lora', sans-serif;
}
.branding {
float: left;
margin-left: 200px;
}
.branding h2 {
margin-top: 10px;
text-transform: uppercase;
font-size: 28px;
}
.branding h5 {
margin-top: -20px;
font-size: 16px;
}
.directory {
float: right;
margin-right: 200px;
}
.search {
background-color: black;
border: 5px solid black;
border-radius: 8px;
padding: 1px 0px 5px 12px;
}
.search input[type=text] {
background-color: #FCD05D;
border-radius: 3px;
}
.search input[type=submit] {
background-color: #595657;
color: #FCD05D;
border: 2px solid #595657;
border-radius: 3px;
}
.index ul {
list-style-type: none;
text-decoration: none;
margin-top: -0;
}
.index li {
margin-top: -20px;
font-size: 14px;
display: inline-flex;
word-spacing: 1px;
}
The extra space is coming from the ul where your links are. Since the width is auto, the list section has a greater width than your search section so the search section takes on that width.
You can set padding: 0 to the ul list to reduce some of the space. It has a natural padding to the left. This will still leave some space on the right because of the length of your list. You can set width to the search area to prevent the list from wrapping. Or you could make the search section float left but you will need to adjust padding to make it look symmetrical
Here is an example
https://jsfiddle.net/jb7j6ysz/3/
.search {
background-color: black;
border: 5px solid black;
border-radius: 8px;
padding: 1px 12px 5px 12px;
float: left;
}
.index ul {
list-style-type: none;
text-decoration: none;
margin-top: 0;
padding: 0;
}
I used float for the new fiddle and added padding 0 to the ul. Also adjusted the padding on .search
The index div is in the way. Update your css with this
.index{
position: absolute;
display:block;
left: 40%;
}
The extra space is coming because of your Ul items. Add this in your css
ul{
padding-left:0px;
}
I think your problem is to do with the width of the .index div. Both it and your search bar are contained within the same .directory div. Because both are block-level elements with their width set to the default auto, they take on the width of their parent, which in this case is set by the largest child, the .index div.
By setting the search bar to display: inline-block;, it will only take up as much width as it needs.
.search {
...
display: inline-block;
}
Additionally, the ul used for the .index div has padding-left by default, which you may want to set otherwise.

Created color boxes for a legend in HTML and CSS, but can't get two color boxes on the same line

I'm currently in the process of creating a legend for a table that has highlighted rows, but I can't seem to get two color boxes on the same li.
<ul>
<li>
<div class="input-color">
<input type="text" value="Blue/White - Alternating Rows" readonly="true" style="border:0;width:200px"/>
<div class="color-box" style="background-color: #6DC2FF;"></div>
<div class="color-box" style="background-color: white;"></div>
</div>
</li>
</ul>
With the following CSS...
ul {
list-style: none;
margin: 0;
padding: 0;
}
.input-color {
position: relative;
}
.input-color input {
padding-left: 20px;
margin-bottom: 10px;
}
.input-color .color-box {
width: 10px;
height: 10px;
display: inline-block;
background-color: #ccc;
position: absolute;
left: 5px;
top: 5px;
border: 1px solid #000;
}
Any ideas? Assuming I know how to use JSFiddle, here it is:
https://jsfiddle.net/1ywpxxks/1/
You can use CSS float: left; to prevent div from breaking lines. You can also set disply: inline-block;.

Nested divs won't create a box inside a box?

I'm creating a section that spans 50% of the page. Within that section I would like to place a box of text containing two lines which will lineup with the bullet points on the list to the righthand side. Why is it not putting the box inside the main section if I nested the divs?
<div class="content">
<h2>Brigham Young University</h2>
<h3><span>Computer Engineering, Minor in Computer Science</span></h3>
<ul>
<li>3.36 GPA</li>
<li>4.0 STEM GPA</li>
</ul>
<div id="grad_date">
<p>Provo, UT <br>
Expected 2018</p>
</div>
</div>
The Css:
.content {
border-width: 3px;
border-style: solid;
border-color: black;
margin-left: 15px;
margin-right: 15px;
width: 50%;
}
.content #grad_date {
border-width: 2px;
border-color: red;
border-style: solid;
width: 100px;
float: right;
}
Add display: inline-block; to .content:
JS Fiddle
You need to change the display rule for the unordered list to inline-block.
Also make sure to clear the float by adding overflow: hidden to the .container div. Which is one way to do it.
.content {
border-width: 3px;
border-style: solid;
border-color: black;
margin-left: 15px;
margin-right: 15px;
width: 50%;
overflow: hidden;
}
.content ul {
display: inline-block;
}
.content #grad_date {
border-width: 2px;
border-color: red;
border-style: solid;
width: 100px;
float: right;
}
<div class="content">
<h2>Brigham Young University</h2>
<h3><span>Computer Engineering, Minor in Computer Science</span></h3>
<ul>
<li>3.36 GPA</li>
<li>4.0 STEM GPA</li>
</ul>
<div id="grad_date">
<p>Provo, UT <br />
Expected 2018</p>
</div>
</div>

Google sites content taking up entire window

I am working on a Google site for a school project. However, the site looks like
instead of
I did not add the extra stuff, Google sites added it for me. Is there any way to get rid of it?
.titlebox {
display: block;
margin: 10px;
padding: 50px;
background-color: yellow;
border-radius: 10px;
border: 2px solid black;
text-align: center;
}
.map {
margin: 10px;
display: inline;
float: left;
padding: 20px;
background-color: green;
border-radius: 10px;
border: 2px solid black;
}
.content {
margin: 10px;
display: inline;
float: right;
padding: 20px;
background-color: orange;
border-radius: 10px;
border: 2px solid black;
}
a div {
color: black;
text-decoration: none;
padding: 5px;
border-radius: 10px;
border: 2px;
}
a:hover div {
color: orange;
text-decoration: none;
padding: 5px;
border-radius: 10px;
border: 2px;
background-color: blue;
}
<div class="titlebox">
<h1>GMO DEBATE</h1>
</div>
<div class="map">
<div text-align="center">
<h3>pages:</h3>
</div>
<ul>
<li>
<a href="pro">
<div>why GMOs should be labeled</div>
</a>
</li>
<li>
<a href="con">
<div>why GMOs shouldn't be labeled</div>
</a>
</li>
<li>
<a href="info">
<div>background information</div>
</a>
</li>
</ul>
</div>
<div class="content">
<h3>Should GMOs be labeled?</h3>
</div>
That is in a code box, although I don't think it matters since the extra stuff was there before I even added anything. Adding a width to the elements does not help.
As you said its code box in code box you can display your content only in limited area you will be allotted only some give space 75% or 70% of page display area.
If you need Your website on full page like as you want find a free host site like http://www.000webhost.com and host you web pages you can do what ever you want

Inner div to scroll if outer div is too small?

I'm trying to make a sidebar which on a website which will have a "panel" in it containing
contact info. The problem is that on smaller screens, the text overflows the background.
Here is the CSS, where #navigation is the outer div and the inner div is called .innerPanel HTML to follow:
#navigation{
position: absolute;
left: 1.5625em;
top: 1.5625em;
bottom: 1.5625em;
display: block;
width: 12.5em;
background: navy;
border-right: 1px solid navy;
text-align: center;
background: #B6D2F0;
padding: 5px;
color: #4A4A49;
overflow: hidden;
}
#navigation .innerPanel{
min-height: 200px; /* supply current height here */
height: auto;
overflow: auto;
}
.titleHead{
display: block;
padding-top: 0.9em;
overflow: auto;
}
/* inverted corners for the links */
#navigation #links {
position: relative;
padding-top: 30px;
}
#navigation #links div div div h3{
border-top: 1px solid navy;
border-bottom: 1px solid navy;
color: navy;
padding: 0px;
margin: 0px;
margin-top: 1px;
line-height: 1.2em;
}
#navigation div div div div ul{
list-style-type: none;
margin: 0px;
padding: 0px;
}
#navigation div div div div ul li{
text-align: center;
}
#navigation div div div div ul li a{
display: block;
text-decoration: none;
font-weight: bold;
color: #B6D2F0;
padding: 0px;
padding-left: 0;
line-height: 2.5em;
background: navy;
border-bottom: #D8F4F2 1px dashed;
}
#navigation div div div div ul li a:hover{
display: block;
text-decoration: none;
font-weight: bold;
color: #D8F4F2;
background: #0000A2;
}
#navigation div div div div ul #last a{
border-bottom: 0px;
}
`
Here is the HTML fragment. The nested div tags were for rounded corners, which were "nixed" by the client
<div id="navigation">
<div id="logo" class="box">
<div>
<div>
<div style="text-align: center;">
<img src="./images/pictures/cbk-logo-sm.gif" alt="Logo" />
</div>
</div>
</div>
</div>
<div id="links" class="box">
<div>
<div>
<div> <ul>
<li id="home">
Home
</li><li>
Applications
</li><li id="last">
About
</li>
</ul><div class="innerPanel"><div class="innerMost"><h4 class="titleHead">
Contact Information</h4>
<h5 style="margin: 0.8em 0 0 0; padding: 0;">City Office (September-June)</h5>
<p style="font-size: 0.75em; margin: 0; padding: 0;">
<em>Phone:</em> 555-555-5555<br />
<em>Fax:</em> 555-555-5555<br />
<em>Email:</em> email#provider.com<br />
<em>Address:</em> 123 Main Avenue Somewhere, IL 11234
</p>
<h5 style="margin: 0.8em 0 0 0; padding: 0;">Camp (July & August)</h5>
<p style="font-size: 0.75em; margin: 0; padding: 0;">
<em>Phone:</em> 987-654-3210<br />
<em>Fax:</em> 123-456-1234<br />
<em>Email:</em> email#provider.com<br />
<em>Address:</em> 456 Centre Road, Nowhere, AL 67891
</p></div></div> </div>
</div>
</div>
</div>
</div>
I need a cross-browser solution to make innerPanel dynamically add a scrollbar to itself so that on smaller screens, the content is clipped but accessible via scroll...
Preferably, the solution should be pure CSS.
Any ideas?
EDIT: I apologize for the ambiguity. I have a sidebar, called #navigation. It contains a logo, the menu and the contact information. I want the contact info to scroll where needed.
Everything else seems to display normally on 800x600 screens and up.
EDIT: As it stands now, innerPanel is a fixed height. I would like it to grow when possible, and if there is enough room, eliminate the scrollbar.
Please note that there is an HTML div not mentioned in the CSS, which is contained inside of innerPanel.
I am a little unclear what you are asking, but it seems to me you either want overflow:auto on the #navigation element, or depending on your content and why it has a fixed height:
#navigation .innerPanel {
max-height: 200px; /* supply current height here */
height: auto;
overflow: auto;
}
DOES NOT WORK IN IE6
IE6 does not support max-height.