How to display a forum link and user who posted it in my forum? - html

I would like to display a forum link, which at right side should also display a user with latest post or thread in a forum.
Apparently here is what I have done.
CODE HTML:
<div class="container">
<div class="toggle"></div>
<h2>INFORMACJE</h2>
<div class="city">
<ul>
<li>ogłoszenia i nowości</li>
<li>Feedback</li>
</ul>
</div>
</div>
CODE CSS:
.toggle {
display:inline-block;
height:48px;
width:48px;
float: right;
background:url("http://cdn2.iconfinder.com/data/icons/onebit/PNG/onebit_32.png");
}
.toggle.expanded{
background:url("http://icons.iconarchive.com/icons/pixelmixer/basic/48/plus-icon.png");
}
h2 {
color: white;
background-color: rgb(36, 37, 38);
padding: 11px 10px 11px 10px;
margin: 0;
border-width: 0;
border-radius: 4px;
border: 1px solid rgb(70, 70, 70);
margin-bottom: 10px;
}
Here is what I get :(
Here is how the final results should look.
How can I achieve that? am newbie please help
check it in jsfiddle: https://jsfiddle.net/kh3u0q0r/

Is this is what you looking for???
.toggle {
display: inline-block;
height: 48px;
width: 48px;
float: right;
background: url("http://cdn2.iconfinder.com/data/icons/onebit/PNG/onebit_32.png");
}
.first {
float: left;
}
.second {
float: right;
}
.toggle.expanded {
background: url("http://icons.iconarchive.com/icons/pixelmixer/basic/48/plus-icon.png");
}
h2 {
color: white;
background-color: rgb(36, 37, 38);
padding: 11px 10px 11px 10px;
margin: 0;
border-width: 0;
border-radius: 4px;
border: 1px solid rgb(70, 70, 70);
margin-bottom: 10px;
}
<div class="container">
<div class="toggle"></div>
<h2>INFORMACJE</h2>
<div class="city">
<ul>
<li class="first">ogłoszenia i nowości
</li>
<li class="second">
Feedback
</li>
</ul>
</div>
</div>

Related

I need to align the text, so that "current" is on the same line as the rest of the navigation links

I need to align my text.
Current it reads in the nav menu:
Home
Visit us Shop Our History
I need it to be on the same line, and not have home above the rest.
.navigation {
background-color: #333333;
Width: 1024px;
color: #fefefe;
font-size: 120%;
}
#current {
border-bottom: 3px;
border-style: solid;
border-color: #ff0000;
border-top: 0px;
border-left: 0px;
border-right: 0px;
width: 200px;
}
<nav class="navigation">
<p>
<div id="current"> Home </div>
Visit Us
Shop
our History
</p>
</nav>
I am SUPER new to this niche.
You can use flexbox here
.navigation {
...
display: flex;
align-items: center;
}
.navigation {
background-color: #333333;
width: 1024px;
color: #fefefe;
font-size: 120%;
display: flex;
align-items: center;
}
#current {
border-bottom: 3px;
border-style: solid;
border-color: #ff0000;
border-top: 0px;
border-left: 0px;
border-right: 0px;
width: 200px;
}
<nav class="navigation">
<p>
<div id="current"> Home </div>
Visit Us
Shop
our History
</p>
</nav>
Using an 'inline element' like <span> as opposed to a 'block-level element' like <div> will fix that.
MDN
.navigation {
background-color: #333333;
Width: 1024px;
color: #fefefe;
font-size: 120%;
}
#current {
border-bottom: 3px;
border-style: solid;
border-color: #ff0000;
border-top: 0px;
border-left: 0px;
border-right: 0px;
width: 200px;
}
<nav class="navigation">
<p>
<span id="current">Home</span>
Visit Us
Shop
our History
</p>
</nav>

how to create this design: Work Experience Tree Template

I want to make a design similar to this one:
But i am running out of ideas how to make this. Can anyone give me some hints or help me with demo.
Any help will be much appreciated.
Thank You
.list-component {
border-left: 1px solid gray;
list-style: none;
margin-left: 10px;
padding-top: 20px
}
/* https://www.computerhope.com/issues/ch001705.htm */
.list-component .__item {
background: url(https://www.computerhope.com/issues/pictures/bullet.gif) no-repeat top left;
background-position: top left;
padding: 0 0 4px 60px;
margin-left: 1em;
position: relative;
right: 67px;
margin-bottom: 10px;
top: 10px;
}
.card-component {
border: 1px solid gray;
border-radius: 5px;
padding: 1em;
max-width: 450px;
font-family: Arial;
position: relative;
bottom: 20px;
}
.card-component .__year {}
.card-component .__title {
font-size: 1em;
}
.card-component .__text {
color: gray;
}
<ul class="list-component">
<li class="__item">
<div class="card-component">
<h2 class="__year">2010 - 2014</h2>
<h1 class="__title">Studied at Michigan State University</h1>
<p class="__text">Blah Blah Blah</p>
</div>
</li>
<li class="__item">
<div class="card-component">
<h2 class="__year">2014 - 2016</h2>
<h1 class="__title">Master In Computer Science</h1>
<p class="__text">Blah Blah Blah</p>
</div>
</li>
</ul>
As commented before - you should have come with something before asking the question.
But since it was a nice exercise. please see a demo here: https://jsfiddle.net/1or582su/
It is not completed. But you can take it from here.
ul {
border-left: 1px solid black;
padding: 0;
list-style-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='-1 -1 2 2'><circle r='1' /></svg>");
}
li {
margin-left: 8px;
border: 1px solid black;
border-radius: 5px;
width: 400px;
padding: 10px;
margin-bottom: 10px;
}
.years, .header {
font-size: 1.2em;
font-weight: bold;
}
<ul>
<li>
<div class="years">2001-2003</div>
<div class="header">Studied at Cambridge</div>
<div class="content">Lorem ipsum whatever</div>
</li>
<li>
<div class="years">2001-2003</div>
<div class="header">Studied at Cambridge</div>
<div class="content">Lorem ipsum whatever</div>
</li>
</ul>

Put two divs one near the other

I have the following html code:
<div class="demand page">
<div id="crumby-title">
<div class="page-icon">
<i class="fa fa-line-chart"></i>
</div>
<div class="page-title">
Demand
</div>
</div>
<div id="chart" class="demand-chart">
</div>
</div>
and the css/less:
.rtm {
.app__header {
background-color: #ffffff;
box-shadow: 1px 2px 2px rgba(1, 1, 1, 0.15);
}
.app__inner-content {
background-color: #ffffff;
}
.demand-chart{
padding-top: 50px;
}
#crumby-title {
display: block;
border-bottom: 1px solid #eee;
}
.page-icon {
font-size: 20px;
position: absolute;
padding: 14px 18px;
background: #e7e7e7;
}
.page-title {
float: left;
font-size: 20px;
font-weight: 5px 10px 10px 75px;
height: 55px;
}
}
I tried to do like this in order to show the page-icon and page-title one near the other but how it is done now they are one over the other (the icon is on top of the title)
How can I solve this? Thanks
When you say "near each other" I am assuming you mean "beside each other".
You can add flexbox properties to #crumby-title. Then remove position and float properties from .page-icon and page-title. You can also remove height from .page-title
.app__header {
background-color: #ffffff;
box-shadow: 1px 2px 2px rgba(1, 1, 1, 0.15);
}
.app__inner-content {
background-color: #ffffff;
}
.demand-chart {
padding-top: 50px;
}
#crumby-title {
display: flex;
align-items: center;
border-bottom: 1px solid #eee;
}
.page-icon {
font-size: 20px;
padding: 14px 18px;
background: #e7e7e7;
}
.page-title {
font-size: 20px;
font-weight: 5px 10px 10px 75px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div class="demand page">
<div id="crumby-title">
<div class="page-icon">
<i class="fa fa-line-chart"></i>
</div>
<div class="page-title">
Demand
</div>
</div>
<div id="chart" class="demand-chart">
</div>
</div>
Give float:left to .page-icon instead of position:absolute and add <div class="clear"></div> after page-title.
.app__header {
background-color: #ffffff;
box-shadow: 1px 2px 2px rgba(1, 1, 1, 0.15);
}
.app__inner-content {
background-color: #ffffff;
}
.demand-chart{
padding-top: 50px;
}
#crumby-title {
display: block;
border-bottom: 1px solid #eee;
}
.page-icon {
font-size: 20px;
float: left;
padding: 14px 18px;
background: #e7e7e7;
}
.page-title {
float: left;
font-size: 20px;
font-weight: 5px 10px 10px 75px;
height: 55px;
}
.clear{
clear:both;
}
<div class="demand page">
<div id="crumby-title">
<div class="page-icon">
<i class="fa fa-line-chart"></i>
</div>
<div class="page-title">
Demand
</div>
<div class="clear"></div>
</div>
<div id="chart" class="demand-chart">
</div>
</div>
I want to show u another version of ankita pantel's put them in a table and add padding-top to Demand
.app__header {
background-color: #ffffff;
box-shadow: 1px 2px 2px rgba(1, 1, 1, 0.15);
}
.app__inner-content {
background-color: #ffffff;
}
.demand-chart{
padding-top: 50px;
}
#crumby-title {
display: block;
border-bottom: 1px solid #eee;
}
.page-icon {
font-size: 20px;
padding: 14px 18px;
background: #e7e7e7;
}
.page-title {
padding-top: 30px;
float: left;
font-size: 20px;
font-weight: 5px 10px 10px 75px;
height: 55px;
}
<div class="demand page">
<div id="crumby-title">
<table>
<tr>
<td>
<div class="page-icon">
<i class="fa fa-line-chart"></i>
</div>
</td>
<td>
<div class="page-title">
Demand
</div>
</td>
</tr>
</table>
</div>
<div id="chart" class="demand-chart">
</div>
</div>
All the cool kids are using flex box.
display:flex; flex-direction:row; makes the child items stack in a row. (flex-direction:row is default so you can skip that)
#crumby-title {
...
display: flex;
flex-direction:row;
}
then you can (if you want) center the text with
.page-title {
....
display: flex;
align-items: center;
}
Fiddle

Align navbar list to right and keep image and selector on left

Im tring here to set the list tags to float right in the navbar and keep my image at the left and the selector with it, and trying to set the search over the list aswell. Already try everything, im just starting with coding and cant find a way to solve
.fixed-top {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
top: 0;
border-width: 0 0 1px;
}
#nav ul li a {
display: block;
padding: 7px 15px;
text-decoration: none;
font-weight: bold;
color: #FFFFFF;
}
#nav li a:hover {
color: #000000;
background-color: #fff;
}
select option {
margin: 40px;
background: rgba(0, 0, 0, 0.3);
color: #fff;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
select {
margin-left: 10px;
padding-left: 20px;
padding-top: 5px;
background: #696969;
color: #FFFFFF;
border: none;
}
input[type=text] {
margin-left: 840px;
}
.navbar-superior {
float: right;
margin-bottom: -20px;
}
.contenedora {
width: 100%;
float: right;
margin: auto;
padding: 0;
list-style: none;
background-color: #696969;
box-shadow: 10px 0 10px #000000;
border-bottom: 1px solid #000000;
border-top: 1px solid #000000;
}
.navbar-derecha li {
float: left;
}
.contenedora * {
float: left;
list-style: none;
}
<div id="nav" class="fixed-top">
<div class="contenedora">
<!-- Navegador Superior - logo -->
<a href="">
<img src="images/logo.png">
</a>
<select>
<option val="">Argentina</option>
<option val="1">Algeria</option>
<option val="2">..</option>
<option val="3">...</option>
<option val="4">....</option>
</select>
<input type="text" placeholder="Buscar"><i class="material-icons">search</i>
</input>
<div class="navbar-superior">
<ul class="navbar-derecha">
<li>Soluciones para
</li>
<li>Contáctenos
</li>
<li>Mi Cuenta
</li>
<li>Carrito
</li>
</ul>
</div>
<!-- Navbar Derecha -->
</div>
<!-- Navegador superior -->
</div>
Try removing the asterisk "*" from .contenedora * {...}, And instead add the list-style:none to the .navbar-derecha li {...} class.
Also remove margin-bottom: -20px; form your .navbar-superior {...} class such that it looks like
.navbar-superior {
float: right;
}
Remove the margin-left from the input[type=text], Wrap your text-input and your search text in a div tag which you have to float to the right
<div style="float:right;">
<input type="text" placeholder="Buscar"><i class="material-icons">search</i>
</div>
Make sure your code looks like in the example below.
.fixed-top {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
top: 0;
border-width: 0 0 1px;
}
#nav ul li a {
display: block;
padding: 7px 15px;
text-decoration: none;
font-weight: bold;
color: #FFFFFF;
}
#nav li a:hover {
color: #000000;
background-color: #fff;
}
select option {
margin: 40px;
background: rgba(0, 0, 0, 0.3);
color: #fff;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}
select {
margin-left: 10px;
padding-left: 20px;
padding-top: 5px;
background: #696969;
color: #FFFFFF;
border: none;
}
input[type=text] {} .navbar-superior {
float: right;
}
.contenedora {
width: 100%;
float: right;
margin: auto;
padding: 0;
list-style: none;
background-color: #696969;
box-shadow: 10px 0 10px #000000;
border-bottom: 1px solid #000000;
border-top: 1px solid #000000;
}
.navbar-derecha li {
float: left;
list-style: none;
}
.contenedora {
float: left;
}
<div id="nav" class="fixed-top">
<div class="contenedora">
<!-- Navegador Superior - logo -->
<a href="">
<img src="images/logo.png">
</a>
<select>
<option val="">Argentina</option>
<option val="1">Algeria</option>
<option val="2">..</option>
<option val="3">...</option>
<option val="4">....</option>
</select>
<div style="float:right;">
<input type="text" placeholder="Buscar"><i class="material-icons">search</i>
</div>
</input>
<div class="navbar-superior">
<ul class="navbar-derecha">
<li>Soluciones para
</li>
<li>Contáctenos
</li>
<li>Mi Cuenta
</li>
<li>Carrito
</li>
</ul>
</div>
<!-- Navbar Derecha -->
</div>
<!-- Navegador superior -->
</div>
Hope that helped you.

Centering CSS/HTML text vertically

I am making a webpage using CSS when I encountered a problem. My menu bar doesn't center the links vertically in the bar. It should be really simple, but I need help. Sorry for making it so long, I just didn't want to leave anything out.
HTML:
<html>
<head>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<title>noobyDev</title>
<style>
body {
background-color: CCFFFF;
text-align: center;
}
div.background
{
width: 90%;
height: 200px;
background color: #00FF66;
border: 2px solid black;
margin: 0 auto;
text-align: left;
}
div.background h3
{
margin: 0px 40px;
}
div.logo
{
width: 350px;
height: 75px;
background: url(logo.png);
margin: 30px 40px;
}
div.nav
{
background-color: #00CC66;
border: 2px solid black;
width: 90%;
margin: 0 auto;
text-align: left;
height: 30px;
border-top: 0px solid black;
}
.menu
{
margin: 5px 10px;
background: #00CC66;
color: black;
-webkit-transition: color;
}
.menu:hover
{
color: red;
}
div.center
{
width: 90%;
height: 700px;
background color: white;
border: 2px solid black;
border-top: 0px solid black;
margin: 0 auto;
text-align: left;
}
div.column1 h1
{
margin: 30px 40px;
}
div.column1 p
{
margin: 30px 40px;
}
div.column1
{
width: 70%;
height: 100%;
float: left;
display: block;
border-right: 2px solid black;
}
div.column2
{
width: 30%
height: 100%;
float: left;
display: block;
text-align: left;
}
div.column2 a
{
margin: 30px 40px;
display: block;
text-decoration: none;
font-size: 30px;
font-color: black;
}
div.legal
{
width:90%;
height: 50px;
background color: white;
border: 2px solid black;
border-top: 0px solid black;
margin: 0 auto;
text-align: center;
}
</style>
</head>
<body>
<div class="background">
<div class="logo">
</div>
<h3>Have you failed today?</h3>
</div>
<div class="nav">
<a style=text-decoration="none" href="index.html" class="menu">Home</a>
<a style=text-decoration="none" href="html.html" class="menu">HTML</a>
<a style=text-decoration="none" href="javascript.html" class="menu">Javascript</a>
<a style=text-decoration="none" href="css.html" class="menu">CSS</a>
<a style=text-decoration="none" href="java.html" class="menu">Java</a>
<a style=text-decoration="none" href="news.html" class="menu">News</a>
<a style=text-decoration="none" href="games.html" class="menu">Games</a>
<a style=text-decoration="none" href="other.html" class="menu">Other</a>
</font>
</div>
<div class="center">
<div class="column1">
<h1>Home</h1>
<br>
<p>Welcome to noobyDev.com! This is my site where I document all of my fails and successes worth sharing. Feel free to use them unless otherwise instructed to do so. Check back often and admire my awesomeness!</p>
</div>
<div class="column2">
Video?
</div>
</div>
<div class="legal">
<p>This site is heavily protected with a gargantuan army of mutant cotton balls; I would recommend not stirring trouble up. Just so you know, this site looks the best in Internet Explorer.</p>
</div>
</body>
</html>
Just add a line-height to div.nav:
div.nav
{
background-color: #00CC66;
border: 2px solid black;
width: 90%;
margin: 0 auto;
text-align: left;
height: 30px;
line-height: 30px;
}
Here's the JS Bin to test: http://jsbin.com/oliwit/1/
There are generally a lot of misconceptions on how to utilize the vertical-align within CSS, I found this post very helpful on how to get a full understanding of it... http://phrogz.net/css/vertical-align/