I have this HTML structure:
.subject{
width: 50px;
}
<div>
<span class = "subject">Name:</span>
<span class="content">John</span>
</div>
<div>
<span class = "subject">Age:</span>
<span class="content">23</span>
</div>
<div>
<span class="subject">cell phone:</span>
<span class="content">+9400321532</span>
</div>
As you see, those columns aren't in the same line. I want this output:
/*
Name: John
Age: 23
cell phone: +9400321532
How can I do that?
Actually I need a fixed-width for span.subject the size of biggest content length which is cell phone in this case.
Here is my code in reality:
.notifications_list{
margin-top: 1px;
padding-right: 15px;
direction: rtl;
overflow: scroll;
width: 100%;
height: 100%;
}
.notifications_list li{
list-style: none;
}
.notification_date_title{
font-size: 14px;
margin-top: 10px;
}
.note_icon{
}
.note_icon i{
font-size: 20px;
margin: 0px;
}
.note_type{
margin-right: 5px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="notifications_list">
<div class="notification_date_title">امروز +5</div>
<ul>
<li><a><div><span class="note_icon"><i class="fa fa-sort"></i></span><span class="note_type">رای</span><span class="note_date_time">2 ساعت قبل</span></div></a>
</li>
</ul>
<div class="notification_date_title">دیروز +10</div>
<ul>
<li><a><div><span class="note_icon"><i class="fa fa-sort"></i></span><span class="note_type">رای</span><span class="note_date_time">14 ساعت قبل</span></div></a>
</li>
</ul>
<div class="notification_date_title">در هفته گذشته </div>
<ul>
<li><a><div><span class="note_icon"><i class="fa fa-check"></i></span><span class="note_type">تایید جواب</span><span class="note_date_time">2 روز قبل</span></div></a>
</li>
<li><a><div><span class="note_icon"><i class="fa fa-sort"></i></span><span class="note_type">رای</span><span class="note_date_time">3 روز قبل</span></div></a>
</li>
</ul>
</div>
You can use display:table, display:table-row and display:table-cell to make span as table
Use display: table-cell;
.subject {
display: table-cell;
width: 80px;
}
div {
display: table-row;
}
<div>
<span class="subject">Name:</span>
<span class="content">John</span>
</div>
<div>
<span class="subject">Age:</span>
<span class="content">23</span>
</div>
<div>
<span class="subject">cell phone:</span>
<span class="content">+9400321532</span>
</div>
Please try this:
.subject{
width: 82px;
display: table-cell;
float: left;
}
You can make use of display table-row and table-cell to achieve this. Below code you can see that the width of the longest content is taken as the width if not it will take a min-width of 50px;
Hope this is what you are expecting :
.notifications_list{
margin-top: 1px;
padding-right: 15px;
direction: rtl;
overflow: scroll;
width: 100%;
height: 100%;
display: table;
}
.notifications_list div, .notifications_list ul{
display: table-row;
}
.notifications_list li{
list-style: none;
}
.notification_date_title{
font-size: 14px;
margin-top: 10px;
}
.note_icon{
}
.note_icon i{
font-size: 20px;
margin: 0px;
}
.note_type{
margin-right: 5px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="notifications_list">
<div class="notification_date_title">امروز +5</div>
<ul>
<li><a><div><span class="note_icon"><i class="fa fa-sort"></i></span><span class="note_type">رای</span><span class="note_date_time">2 ساعت قبل</span></div></a>
</li>
</ul>
<div class="notification_date_title">دیروز +10</div>
<ul>
<li><a><div><span class="note_icon"><i class="fa fa-sort"></i></span><span class="note_type">رای</span><span class="note_date_time">14 ساعت قبل</span></div></a>
</li>
</ul>
<div class="notification_date_title">در هفته گذشته </div>
<ul>
<li><a><div><span class="note_icon"><i class="fa fa-check"></i></span><span class="note_type">تایید جواب</span><span class="note_date_time">2 روز قبل</span></div></a>
</li>
<li><a><div><span class="note_icon"><i class="fa fa-sort"></i></span><span class="note_type">رای</span><span class="note_date_time">3 روز قبل</span></div></a>
</li>
</ul>
</div>
Try this also:
.subject{
width: 50%;
float:left;
}
.content{width: 50%;
float:right;
}
<div>
<span class = "subject">Name:</span>
<span class="content">John</span>
</div>
<div>
<span class = "subject">Age:</span>
<span class="content">23</span>
</div>
<div>
<span class="subject">cell phone:</span>
<span class="content">+9400321532</span>
</div>
Related
I have an HTML page with a list of items and their descriptions. The styling is done exclusively in CSS, in the pursuit of keeping information separate from layout.
Is it possible to use only CSS so that for every other row, the columns are reversed? I'd like to avoid using an HTML table, or manually reversing the columns in HTML, and I'd like to keep using <ul> and <li>, since it matches the kind of data that is displayed.
What I have:
img {
max-width: 50px;
height: auto;
}
ul {
list-style-type: none;
border-collapse: collapse;
display: table;
}
.item-name, .item-details {
display: table-row;
}
.item-pic, .item-text {
display: table-cell;
vertical-align: top;
padding: 10px;
}
.item-name {
font-weight: bold;
}
<html>
<body>
<ul>
<li><span class="item-pic"><img src="green.gif"></span>
<span class="item-text">
<span class="item-name">Green</span>
<span class="item-details">This is a green item</span>
</span>
</li>
<li><span class="item-pic"><img src="red.gif"></span>
<span class="item-text">
<span class="item-name">Red</span>
<span class="item-details">This is a red item</span>
</span>
</li>
<li><span class="item-pic"><img src="blue.gif"></span>
<span class="item-text">
<span class="item-name">Blue</span>
<span class="item-details">This is a blue item</span>
</span>
</li>
<li><span class="item-pic"><img src="yellow.gif"></span>
<span class="item-text">
<span class="item-name">Yellow</span>
<span class="item-details">This is a yellow item</span>
</span>
</li>
</ul>
</body>
</html>
What I would like:
You can use the following CSS code. It uses display:flex on the li tags, with reverse order on every second one (:nth-child(even)) , and display: block on the two text spans to make them go across the whole width of their parent and therefore place them below each other. Other details see below:
(The width of the container can be adjusted as desired, it could as well be 100% to span the whole width of its parent)
img {
max-width: 50px;
height: auto;
}
ul {
list-style-type: none;
display: block;
width: 200px;
padding: 0;
}
ul>li {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
ul>li:nth-child(even) {
flex-direction: row-reverse;
}
.item-text > * {
display: block;
}
.item-pic,
.item-text {
padding: 10px;
}
.item-name {
font-weight: bold;
}
<html>
<body>
<ul>
<li>
<span class="item-pic"><img src="green.gif"></span>
<span class="item-text">
<span class="item-name">Green</span>
<span class="item-details">This is a green item</span>
</span>
</li>
<li><span class="item-pic"><img src="red.gif"></span>
<span class="item-text">
<span class="item-name">Red</span>
<span class="item-details">This is a red item</span>
</span>
</li>
<li><span class="item-pic"><img src="blue.gif"></span>
<span class="item-text">
<span class="item-name">Blue</span>
<span class="item-details">This is a blue item</span>
</span>
</li>
<li><span class="item-pic"><img src="yellow.gif"></span>
<span class="item-text">
<span class="item-name">Yellow</span>
<span class="item-details">This is a yellow item</span>
</span>
</li>
</ul>
</body>
</html>
You can do it with a combination of nth-child and flex. With nth-child, you can easily target alternating rows with odd or even keywords. Then it just a matter of setting the li to flex and changing the order for even row. (EDIT: updated this to use row reverse instead as it is indeed easier)
I removed all the able related styles
img {
max-width: 50px;
height: auto;
}
ul {
list-style-type: none;
border-collapse: collapse;
}
.item-pic,
.item-text {
padding: 10px;
}
.item-name {
font-weight: bold;
display: block; // no need for this if you use a div
}
li {
display: flex;
}
li:nth-child( even ) {
flex-direction: row-reverse;
}
<html>
<body>
<ul>
<li><span class="item-pic"><img src="green.gif"></span>
<span class="item-text">
<span class="item-name">Green</span>
<span class="item-details">This is a green item</span>
</span>
</li>
<li><span class="item-pic"><img src="red.gif"></span>
<span class="item-text">
<span class="item-name">Red</span>
<span class="item-details">This is a red item</span>
</span>
</li>
<li><span class="item-pic"><img src="blue.gif"></span>
<span class="item-text">
<span class="item-name">Blue</span>
<span class="item-details">This is a blue item</span>
</span>
</li>
<li><span class="item-pic"><img src="yellow.gif"></span>
<span class="item-text">
<span class="item-name">Yellow</span>
<span class="item-details">This is a yellow item</span>
</span>
</li>
</ul>
</body>
</html>
I have got this code
HTML:
<div id="tree">
<div>
<div>
<h4>Smartphony</h4>
<ul>
<li>Apple iOS</li>
<li>Android</li>
<li>Odolné smartphony</li>
<li>Dual SIM smartphony</li>
</ul>
</div>
<div>
<h4>Tablety</h4>
<ul>
<li>Apple iOS</li>
<li>Android</li>
<li>Dětské tablety</li>
</ul>
</div>
<div>
<h4>Outdoorové mobily</h4>
</div>
<div>
<h4>Klasické mobily</h4>
<ul>
<li>Klasické</li>
<li>Stolní telefony</li>
<li>Dual SIM</li>
<li>Pro seniory</li>
</ul>
</div>
<div>
<h4>Nositelná elektronika</h4>
<ul>
<li>Fitness náramky</li>
<li>Chytré hodinky</li>
<li>Krokoměry</li>
<li>Řemínky</li>
<li>Příslušenství</li>
</ul>
</div>
<div>
<h4>Powerbanky</h4>
</div>
<div>
<h4>Kabely a redukce</h4>
<ul>
<li>USB-C kabely</li>
<li>USB micro kabely</li>
<li>Lightning kabely</li>
</ul>
</div>
<div>
<h4>Držáky, stativy a selfie</h4>
<ul>
<li>PopSockets</li>
<li>Klasické držáky</li>
<li>Stativy (tripody)</li>
<li>Selfie tyče</li>
<li>Držáky do ventilace</li>
<li>Držáky na opěrku hlavy</li>
<li>Držáky s bezdrátovým nabíjením</li>
<li>Držáky s magnetickým přichycením</li>
<li>Držáky pro tablety</li>
</ul>
</div>
<div>
<h4>Příslušenství pro tablety</h4>
<ul>
<li>Obaly a pouzdra</li>
<li>Fólie</li>
<li>Nabíječky</li>
<li>Stylusy</li>
<li>Ostatní</li>
</ul>
</div>
<div>
<h4>Příslušenství pro smartphony</h4>
<ul>
<li>Obaly a pouzdra</li>
<li>Kryty</li>
<li>Fólie</li>
<li>Baterie</li>
<li>Nabíječky</li>
<li>Dokovací stanice</li>
<li>Ostatní</li>
<li>Gadgets</li>
<li>Handsfree</li>
</ul>
</div>
</div>
</div>
CSS:
#tree{
border-bottom: 1px solid black;
}
#tree ul{
list-style-type: disc;
margin-left: 18px;
}
#tree a{
font-size: 12px;
line-height: 1.6;
}
#tree h4 {
display: block;
margin: 0 0 04px 0;
}
#tree h4 a {
font-size: 16px;
color: #2576d1;
}
#tree > div{
padding: 14px 20px;
width: 100%;
height: 100%;
-moz-column-count:3;
-moz-column-gap: 3%;
-moz-column-width: 30%;
-webkit-column-count:3;
-webkit-column-gap: 3%;
-webkit-column-width: 30%;
column-count: 3;
column-gap: 3%;
column-width: 30%;
}
#tree > div > div{
margin-bottom: 20px;
}
It works almost perfect to set content into 3 columns but I want it to break after every #tree > div > div not after every element.
Here is picture how it looks
And here is how it should look
Thank you and have a nice day
The required result of 3 column layout can be achieved through these 4 steps:
Step 1: Define css classes for table, row and column
Step 2: Specify 3 column layout by making the column class occupy 33% of width
Step 3: Configure the row class to stack columns one below the other when there is not enough screen width
Step 4: Update HTML div elements with the table, row and column classes
Here is the copy of working code that shows 3 columns with responsive design:
<!DOCTYPE html>
<html>
<head>
<title>Tree structure - demo</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.my-table {
border: 1px solid black;
min-width: 180px;
}
.my-list{
list-style-type: disc;
}
.heading4 {
font-size: 16px;
color: #2576d1;
}
.my-column {
float: left;
width: 33%;
min-width: 150px;
}
.my-row:after {
content: "";
display: table;
clear: both;
}
</style>
</head>
<body>
<div id="tree" class="my-table">
<div class="my-row">
<div class="my-column">
<h4 class="heading4">Smartphony</h4>
<ul class="my-list">
<li>Apple iOS</li>
<li>Android</li>
<li>Odolné smartphony</li>
<li>Dual SIM smartphony</li>
</ul>
</div>
<div class="my-column">
<h4 class="heading4">Tablety</h4>
<ul class="my-list">
<li>Apple iOS</li>
<li>Android</li>
<li>Dětské tablety</li>
</ul>
</div>
<div class="my-column">
<h4 class="heading4">Outdoorové mobily</h4>
</div>
</div>
<div class="my-row">
<div class="my-column">
<h4 class="heading4">Klasické mobily</h4>
<ul class="my-list">
<li>Klasické</li>
<li>Stolní telefony</li>
<li>Dual SIM</li>
<li>Pro seniory</li>
</ul>
</div>
<div class="my-column">
<h4 class="heading4">Nositelná elektronika</h4>
<ul class="my-list">
<li>Fitness náramky</li>
<li>Chytré hodinky</li>
<li>Krokoměry</li>
<li>Řemínky</li>
<li>Příslušenství</li>
</ul>
</div>
<div class="my-column">
<h4 class="heading4">Powerbanky</h4>
</div>
</div>
<div class="my-row">
<div class="my-column">
<h4 class="heading4">Kabely a redukce</h4>
<ul class="my-list">
<li>USB-C kabely</li>
<li>USB micro kabely</li>
<li>Lightning kabely</li>
</ul>
</div>
<div class="my-column">
<h4 class="heading4">Držáky, stativy a selfie</h4>
<ul class="my-list">
<li>PopSockets</li>
<li>Klasické držáky</li>
<li>Stativy (tripody)</li>
<li>Selfie tyče</li>
<li>Držáky do ventilace</li>
<li>Držáky na opěrku hlavy</li>
<li>Držáky s bezdrátovým nabíjením</li>
<li>Držáky s magnetickým přichycením</li>
<li>Držáky pro tablety</li>
</ul>
</div>
<div class="my-column">
<h4 class="heading4">Příslušenství pro tablety</h4>
<ul class="my-list">
<li>Obaly a pouzdra</li>
<li>Fólie</li>
<li>Nabíječky</li>
<li>Stylusy</li>
<li>Ostatní</li>
</ul>
</div>
</div>
<div class="my-row">
<div class="my-column">
<h4 class="heading4">Příslušenství pro smartphony</h4>
<ul class="my-list">
<li>Obaly a pouzdra</li>
<li>Kryty</li>
<li>Fólie</li>
<li>Baterie</li>
<li>Nabíječky</li>
<li>Dokovací stanice</li>
<li>Ostatní</li>
<li>Gadgets</li>
<li>Handsfree</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
Output:
you need to set display: inline-block to your #tree > div > divto keep them all together.
#tree{
border-bottom: 1px solid black;
}
#tree ul{
list-style-type: disc;
margin-left: 18px;
}
#tree a{
font-size: 12px;
line-height: 1.6;
}
#tree h4 {
display: block;
margin: 0 0 04px 0;
}
#tree h4 a {
font-size: 16px;
color: #2576d1;
}
#tree > div{
padding: 14px 20px;
width: 100%;
height: 100%;
-moz-column-count:3;
-moz-column-gap: 3%;
-moz-column-width: 30%;
-webkit-column-count:3;
-webkit-column-gap: 3%;
-webkit-column-width: 30%;
column-count: 3;
column-gap: 3%;
column-width: 30%;
}
#tree > div > div{
margin-bottom: 20px;
display: inline-block;
}
<div id="tree">
<div>
<div>
<h4>Smartphony</h4>
<ul>
<li>Apple iOS</li>
<li>Android</li>
<li>Odolné smartphony</li>
<li>Dual SIM smartphony</li>
</ul>
</div>
<div>
<h4>Tablety</h4>
<ul>
<li>Apple iOS</li>
<li>Android</li>
<li>Dětské tablety</li>
</ul>
</div>
<div>
<h4>Outdoorové mobily</h4>
</div>
<div>
<h4>Klasické mobily</h4>
<ul>
<li>Klasické</li>
<li>Stolní telefony</li>
<li>Dual SIM</li>
<li>Pro seniory</li>
</ul>
</div>
<div>
<h4>Nositelná elektronika</h4>
<ul>
<li>Fitness náramky</li>
<li>Chytré hodinky</li>
<li>Krokoměry</li>
<li>Řemínky</li>
<li>Příslušenství</li>
</ul>
</div>
<div>
<h4>Powerbanky</h4>
</div>
<div>
<h4>Kabely a redukce</h4>
<ul>
<li>USB-C kabely</li>
<li>USB micro kabely</li>
<li>Lightning kabely</li>
</ul>
</div>
<div>
<h4>Držáky, stativy a selfie</h4>
<ul>
<li>PopSockets</li>
<li>Klasické držáky</li>
<li>Stativy (tripody)</li>
<li>Selfie tyče</li>
<li>Držáky do ventilace</li>
<li>Držáky na opěrku hlavy</li>
<li>Držáky s bezdrátovým nabíjením</li>
<li>Držáky s magnetickým přichycením</li>
<li>Držáky pro tablety</li>
</ul>
</div>
<div>
<h4>Příslušenství pro tablety</h4>
<ul>
<li>Obaly a pouzdra</li>
<li>Fólie</li>
<li>Nabíječky</li>
<li>Stylusy</li>
<li>Ostatní</li>
</ul>
</div>
<div>
<h4>Příslušenství pro smartphony</h4>
<ul>
<li>Obaly a pouzdra</li>
<li>Kryty</li>
<li>Fólie</li>
<li>Baterie</li>
<li>Nabíječky</li>
<li>Dokovací stanice</li>
<li>Ostatní</li>
<li>Gadgets</li>
<li>Handsfree</li>
</ul>
</div>
</div>
</div>
I'm developing an item list that is filled dinnamically with some data that is getting from a controller.
I had a problem when the data is shown because I need to show it into two columns (called "record_left_content" and "record_right_content"), but when the obtained text is too long, the two columns are merged into one.
Someone knows how to positionate the both colums in a fixed way regardless of the size of the text/content ?
Code:
<div class="col-lg-9" id="middle_column">
<div class="text-center text-muted" t-if="not education_timetable_ids">
<h1>No timetables found</h1>
</div>
<div class="text-center text-muted" t-else="">
<ul class="list-unstyled">
<li t-foreach="education_timetable_ids" t-as="timetable" t-attf-class="media">
<div itemscope="itemscope" class="media-body" itemtype="https://schema.org/learningResourceType" >
<h4>
<a t-attf-href="/" itemprop="url" onclick="return false"><span itemprop="schedule"><t t-esc="timetable.display_name" /> </span></a>
</h4>
<div id="record_left_content">
<div>
<span t-if="timetable.academic_year_id" class="badge badge-info">
<i class="fa fa-clock-o" role="img" aria-label="Academic year" title="Academic year"></i>
Academic year:
<t t-esc="timetable.academic_year_id.name" />
</span>
//more code
<div id="record_right_content">
//more code
</div>
.media {
padding: 10px;
background-color: #e9ecef;
border-radius: 0.25rem;
margin: 10px;
}
#record_left_content {
float: left;
margin-left: 20%;
}
#record_right_content {
float: right;
margin-right: 20%;
}
Thanks for reading!
I'm working on a website. I'm coloring the menu items, but when coloring in the top left image (background color), it gets colored in square.
I would like to have it colored in skewed, so that it follows the black outline.
A screenshot of the problem and some of the html:
Is there anything I could do to make this work?
The html code of the bar:
<div class="iwgh2-bar">
<div class="iw2-layout iw2-default-breakpoint">
<div class="iw2-wrapper iw2-default-margin">
<div class="iw2-inner-wrapper">
<div class="iwgh2-navigation">
<a class="iw2-branded" href="https://www.vlaanderen.be/nl" target="_self">
<div class="iwgh2-branding-logo"></div>
<span>Vlaanderen</span>
</a>
<div class="iw2-menu iw2-menu-has-items" data-show-menu-help="Toon navigatie menu" data-hide-menu-help="Verberg navigatie menu">
<div class="iwgh2-navigation-menu-toggle-wrapper">
<div class="iwgh2-navigation-menu-toggle-animation-wrapper" style="">
<a class="iwgh2-navigation-menu-site" style="" href="http://binnenland.vlaanderen.be">Agentschap Binnenlands Bestuur</a>
<a class="iwgh2-navigation-menu-breadcrumb" style="" href="http://www.gelijkekansen.be">Gelijke Kansen</a>
<a class="iwgh2-navigation-menu-toggle iw2-exclude-from-outbound-link-tracking" href="javascript:;" aria-expanded="false" aria-owns="64ed92f1-fece-e61f-2d15-0af8093d9040" aria-controls="64ed92f1-fece-e61f-2d15-0af8093d9040"><span class="iw2-visually-hidden iw2-help-text"> Toon navigatie menu </span></a>
</div>
</div>
<div class="iwgh2-flyout-wrapper iw2-window-closed" style="display: none; left: 375.4px;" tabindex="-1" id="64ed92f1-fece-e61f-2d15-0af8093d9040">
<div class="iwgh2-search iw2-hidden" role="search">
<div class="iwgh2-form-label">
<label for="iwgh2-search-field">Zoeken</label>
</div>
<div class="iwgh2-form-textfield">
<input id="iwgh2-search-field" class="iwgh2-search-field iwgh2-form-text" name="query" type="search">
</div>
<div class="iwgh2-form-actions">
<div class="iwgh2-form-action">
<div class="iwgh2-form-button">
<input class="iwgh2-form-submit" name="op" value="" type="submit">
</div>
</div>
</div>
</div>
<ul class="iw2-menu-items" tabindex="-1">
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://lokaalbestuur.vlaanderen.be" target="_self">Lokaal Bestuur</a></li>
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://www.thuisindestad.be" target="_self">Vlaams Stedenbeleid</a></li>
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://integratiebeleid.vlaanderen.be" target="_self">Integratie en Inburgering</a></li>
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://www.vlaamserand.be" target="_self">Beleid Vlaamse Rand</a></li>
<li class="iw2-menu-item"><a class="iw2-menu-item-wrapper" href="http://brussel.vlaanderen.be/home.html" target="_self">Beleid Brussel</a></li>
</ul>
</div>
</div>
</div>
<div class="iwgh2-extensions">
<div class="iwgh2-extension-contact" data-show-menu-help="Toon menu" data-hide-menu-help="Verberg menu">
<a class="iwgh2-extension-contact-toggle iw2-exclude-from-outbound-link-tracking" href="http://www.gelijkekansen.be/Praktisch/Contact.aspx" target="_self" aria-owns="906864c8-0db7-9b35-52ce-143b0e4d962a" aria-controls="906864c8-0db7-9b35-52ce-143b0e4d962a" aria-expanded="false"><span class="iw2-visually-hidden iw2-help-text"> Toon menu </span>Contacteer ons</a>
<div class="iwgh2-extension-contact-wrapper iwgh2-flyout-wrapper">
<div class="iwgh2-contact-menu iw2-window-closed iw2-menu-has-items" style="display:none;" tabindex="-1" id="906864c8-0db7-9b35-52ce-143b0e4d962a">
<div class="iwgh2-contact-menu-header">
<span class="iw2-menu-item-title">Gelijke kansen</span>
</div>
<ul class="iw2-menu-items">
<li class="iw2-menu-item iw2-contact-section-entry iw2-contact-section-entry-icon-link iw2-contact-section-entry-type-link"><a class="iw2-menu-item-wrapper" href="http://www.gelijkekansen.be/Praktisch/Contact.aspx" target="_self"><span class="iw2-menu-item-title">Contacteer ons</span>
<div class="iw2-menu-item-description"></div>
</a></li>
<li class="iw2-menu-item iw2-contact-section-entry iw2-contact-section-entry-icon-link iw2-contact-section-entry-type-link"><a class="iw2-menu-item-wrapper" href="http://binnenland.vlaanderen.be/klachten" target="_self"><span class="iw2-menu-item-title">Klachten</span>
<div class="iw2-menu-item-description">Waar kan ik terecht met een klacht?</div>
</a></li>
</ul>
</div>
<div class="iwgh2-windows">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
css:
.iwgh2.iwgh2-redesign .iwgh2-bar {
background-color: #fff;
border-bottom: 1px solid #cbd2da;
}
.iwgh2.iwgh2-redesign.iwgh2-default-margin .iw2-layout .iw2-wrapper.iw2-default-margin {
padding: 0;
}
.iwgh2-bar .iw2-wrapper {
*zoom: 1;
position: relative;
}
.iw2-wrapper .iw2-inner-wrapper {
position: relative;
}
.iwgh2-navigation {
float: left;
white-space: nowrap;
}
.iwgh2.iwgh2-redesign .iwgh2-navigation>a {
color: #333332;
font-size: 1.1875em;
line-height: 2.31579em;
text-transform: none;
transition: color 0.2s;
}
.iwgh2.iwgh2-redesign.iwgh2-redesign-alt .iwgh2-branding-logo {
position: relative;
width: 47px;
background-color: #FFE507;
overflow: hidden;
}
.iwgh2 .iw2-menu {
display: inline-block;
vertical-align: bottom;
position: relative;
}
.iwgh2.iwgh2-redesign.iwgh2-default-margin .iw2-layout {
max-width: none;
}
.iwgh2-bar .iw2-layout {
position: relative;
overflow: visible;
}
Take a look at this fiddle and see if that is what you wanted
#trapezoid {
border-bottom: 100px solid #FFE507;
border-right: 25px solid transparent;
height: 0;
width: 100px;
}
https://jsfiddle.net/CaffeinatedCod3r/r7deqakL/
More CSS Shapes : https://css-tricks.com/the-shapes-of-css/
I want to create a drop down menu, when i click the glyphicon the down arrow, it should view the drop down menu which has these items [Messages, log out, etc..].
However when i click it nothing appears at all, what is missing here?
//Html File:
<html>
<!-- Head -->
<head>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/bootstrap-social.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<!-- Body -->
<body>
<div class="navbar">
<i class="fa fa-home"></i> Marble
<a class="left"> <i onclick="myFunction(this)" class=" fa fa-bell" ></i> Notifications </a>
<a class="left user"> <i class=" fa fa-user-circle"> </i> User </a>
<div class="dropdown">
<a class="editClass dropdown-toggle" data-toggle="dropdown" > <span class=" glyphicon glyphicon-menu-down"></span> </a>
<ul class="dropdown-menu"> //when i remove class="dropdown-menu", the items appears but the drop down is gone, and when i add them back, the items are not shown when i click the drop down icon.
<li> <a> <i class="fa fa-envelope-o"></i> Messages </a> </li>
<li role="separator" class="divider"></li>
<li> <a> <i class="fa fa-hourglass-3"></i> Timeline </a> </li>
<li role="separator" class="divider"></li>
<li> <a> <i class="fa fa-cog"></i> Settings </a> </li>
<li role="separator" class="divider"></li>
<li> <a> <span class="glyphicon glyphicon-log-out"></span> Log Out </a> </li>
<li role="separator" class="divider"></li>
</ul>
</div>
</div>
<div>
<img src="Diagram.png" alt="diagram" width="400" height="300">
</div>
<div>
<p id="sentence"> "You don't have any projects" </p>
<button onclick="createProject()" class="button1 btn btn-lg"> <b> Add Project </b> </button>
</div>
<div>
<form class="form-popup" id="projects">
<h2 align="center"> <span class="glyphicon glyphicon-th"></span> New Project </h2>
<input type="text" placeholder="Project Name" required> <br>
<textarea placeholder="Project Description" required=""></textarea> <br>
<p> Start Date: </p>
<p> End Date: </p>
<input type="Date" name="start Date" required="">
<input type="Date" name="End Date" required="">
<h2 align="center"> <span class="glyphicon glyphicon-book"> </span> References </h2>
<div id="refTextBoxes">
<input type="text" placeholder="Add Reference" required> <br>
</div>
<button onclick="addRef()"> Add another </button> <br>
<button type="submit" onclick="hideAndAdd()" > Done </button>
<!-- class="btn" bt3ml el button shakl kda 7elw -->
</form>
</div>
<script>
function myFunction(x)
{
x.classList.toggle("fa-bell-slash");
}
function createProject()
{
document.getElementById("projects").style.display = "block";
}
function addRef()
{
var totalTextBoxes = document.getElementsByClassName("input_text");
totalTextBoxes = totalTextBoxes.length + 1;
document.getElementById("refTextBoxes").innerHTML=document.getElementById("refTextBoxes").innerHTML+
"<input type='text' class='input_text' id='input_text"+totalTextBoxes+"' placeholder='Add Reference' + required> <br>";
}
function hideAndAdd()
{
var x = document.getElementById("sentence");
x.style.display = "none";
}
</script>
</body>
<!-- Closing of html tag -->
</html>
//Css File:
body
{
font-family: Arial, Helvetica, sans-serif;
/* background-color: #ABB1BA; */
}
.form-popup
{
display: none;
}
/* Style the navigation bar */
.navbar
{
width: 100%;
background-color: #877ebf;
overflow: auto;
}
/* Navbar links */
.navbar a
{
float: left ;
text-decoration: none;
color: #CCCCCC;
font-size: 17px;
padding: 12px;
}
/* Navbar links on mouse-over */
.navbar a:hover, i:hover, span:hover
{
background-color: #555;
cursor: pointer;
}
img
{
display: block;
margin-left: auto;
margin-right: auto;
}
p
{
text-align: center;
font-family: "Arial Black", Gadget, sans-serif;
font-size: 20px;
}
button
{
text-align: center;
font-size: 16px;
margin: 25px 475px;
cursor: pointer;
}
.button1
{
background-color: #CCCCCC;
color: #333333;
border: 4px solid #877ebf;
}
/*
.navbar i.editClass, span.editClass
{
float: right;
}
*/
.left
{
position: absolute;
right:135;
}
.user
{
/*margin: 25px 25px; */
/*float: right;
padding: 100px; */
position: absolute;
right:40;
}
.editClass
{
position: absolute;
right:5;
}
/* Add responsiveness - will automatically display the navbar vertically instead of horizontally on screens less than 500 pixels */
#media screen and (max-width: 500px) {
.navbar a {
float: none;
display: block;
}
}
I'm using here Bootstrap, html, and css.
I think there is problem in the css file, but i can't manage to find where exactly.
You have overflow effectively hidden on your navbar. Remove that.
.navbar {
/* overflow: auto; */
}
Demo
You'll want to get familiar with your browser's document inspector. It'll make diagnosing things like this almost effortless.