I'm pretty set on using Material Design Icons for the simple fact that they have a lot more IT oriented icons so it just makes things much easier. I'd like to achieve something similar to FontAwesome's Fixed Width feature, which ensures there's an even space after the icon that remains consistent.
How icons currently look:
How I want the icons spaced:
As far as I can tell so far, however, MDI does not offer this (or I'm missing it), so what are some ways to achieve something similar efficiently without hacking with !important or setting unnecessary margins?
Store-Info CSS:
.heading-block {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 1em;
margin: 5px 0;
}
.heading-content > .store-info p {
font-weight: 600;
font-size: 1em;
line-height: 10px;
margin: 1.7em 0;
}
.heading-content > .store-info {
margin-left: 1.5em;
}
Store Info HTML:
<div class="heading-content">
<div>
<span contenteditable="true" id="store-number" class="store-number">{{ store.store_number }} </span><span class="divider">/</span><span class="store-name">{{store.name}}</span>
</div>
<div class="store-info">
<p id="address_full"><span class="mdi mdi-map-marker"></span>{{ store.street_address }} {{ store.city }}, {{ store.state }} {{ store.postal }}</p>
<p id="address_pull_hidden" style="display:none;">{{ store.street_address }} {{ store.city }} {{ store.state }} {{ store.postal }}</p>
<p>
<span class="mdi mdi-earth"> </span>
{{ store.timezone }}
</p>
<p>
<span class="mdi mdi-phone"></span>
{{ store.phone }}
</p>
{% if not store.mpls_only %}
<p>
<span class="mdi mdi-phone-voip"></span>
{{ store.xo_tn }}
</p>
{% endif %}
{% if store.mpls_only %}
<p>
<span class="mdi mdi-phone-classic"></span>
MPLS Only
</p>
{% endif %}
<p>
<span class="mdi mdi-map-marker"></span>
<span id="local-time">00:00:00 am</span>
<span class="status open">{{ store.status }}</span>
</p>
<p class='store-closed' style="display: none;">
<span class="mdi mdi-map-marker"></span>
Close Reason: <span class="close_reason">{{ store.close_reason }}</span>
</p>
<p class="weather"><span class="mdi mdi-weather-cloudy"><span id="weather-main">Clear</span></p>
<a target='_blank' class="edit" href="/admin/stores/store/{{store.pk}}/change/">Edit information for Store {{store.store_number}}</a>
</div>
</div>
<br>
<div id="map-wrapper">
<div id="map-container" class="container">
<div id="map"></div>
<div id="pano"></div>
</div>
</div>
Thanks in advance, & worth noting I'm not much of a front end guy so if you see something that seems odd, feel free to mention it!
You can create a class to make that happen.
.mat-fw {
text-align: center;
width: 1.25em;
}
Related
I have a <div> tag which has bootstrap card class inside. Inside that card I have some data. Right now I use default_if_none:" " to not display the data when the data is none but the card class still render out to the template. The question is How can I not display both the data and the div tag with card class when the data is none? In simple words, When there is no data it won't render div tag.
<div class="card" style="background-color: rgb(243, 243, 243);">
<div class="card-top">
<pre class="mt-3" style="font-size: 16px; left: 0; margin-left: -130px;">
<code class="prettyprint">
{{ post.content|default:" " }}
</code>
</pre>
</div>
</div>
Wrap the whole card in an {% if %}
{% if post.content %}
<div class="card" style="background-color: rgb(243, 243, 243);">
<div class="card-top">
<pre class="mt-3" style="font-size: 16px; left: 0; margin-left: -130px;">
<code class="prettyprint">
{{ post.content }}
</code>
</pre>
</div>
</div>
{% endif %}
my problem is that the hight of the content isn't recognised which causes the body to be smaller than the content which leads to a lot more problems.
HTML:
<section id="contentbox">
{% for post in site.posts %}
<article>
<h2>
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h2>
<time datetime="{{ post.date | date: "%Y-%m-%d" }}">{{ post.date | date_to_long_string }}</time>
<p>
{{ post.caption }}
</p>
</article>
{% endfor %}
</section>
CSS:
#contentbox {
height: 100%;
}
article {
width: 45%;
float: left;
height: 120px;
padding: 2px 0 0 2px;
}
I have a bunch of articles listed but the section stays height:0
Put a clear fix element after your floating elements.
E.g.: <div style="clear: both;"></div>
It's a very common issue.
Hi I want to put the login form in the login.html which created by 'bootstrap/wtf.html. But the form of username password et al aligned left as the following image. I want to put the form in the center.
The code is following:
{% extends "common/base.html" %}
{% import 'bootstrap/wtf.html' as wtf %}
{#{% import "macros/_patination.html" as page_macros %}#}
{#<link rel="stylesheet" href="/static/style.css" type="text/css">#}
{% block content %}
<div class = "main-login">
<h1>{{ _('Sign In') }}</h1>
<div class="main-form">
<div class="col-md-4">
{{ wtf.quick_form(form) }}
</div>
</div>
<br>
<p>{{ _('New User?') }} {{ _('Click to Register!') }}</p>
<p>
{{ _('Forgot Your Password?') }}
{{ _('Click to Reset It') }}
</p>
</div>
and css style code:
.main-login{
padding-top: 100px;
text-align: center;
}
.main-form{
/*padding-top: 100px;*/
text-align: center;
/*display: inline-block;*/
}
All you have to do is change the section of code:
<div class="col-md-4">
{{ wtf.quick_form(form) }}
</div>
to
<div class="col-md-4 col-lg-offset-4">
{{ wtf.quick_form(form) }}
</div>
And you should be good.
for my website I'm trying to bring two td closer. They are so far apart, I've been trying to put the td with numbers and td with image together. This is the domain for my webiste:
If you check the code, you can see it's horrible which is probably why I'm having such a hard time trying to bring two td closer.
To be more clear, what I'm trying to do is
<table>
<td class="vert-align" style="padding:0;" >
<div class="votes">
<a href="/post/{{ post.slug }}/vote?is_up=1" class="vote">
<span class="glyphicon glyphicon-triangle-top col-md-12" aria-hidden="true"></span></a>
<br />
<span class="col-md-12" style="height:1px; font-family: 'Passion One', cursive; bottom:10px; padding-left:0.01em;
#and
<td class="vert-align">
{% if post.main_image %}
<h4 id="lineForUrl">
<a href="{{ post.url }}" target="_blank" style="margin-left: 15px; text-decoration:none;"> <img src="{{post.get_image_url}}" class="img-rounded" alt="Cinque Terre" height="75" width="75"/><span id="title-font" title="{{post.title}}">
{{ post.title }}</span><span style="margin-left: 15px;" class="domain">({{ post.domain }})</span></a>
<span class="discuss" style="color:red;">enter</span>
<br />
<span class="post-info">
{% if user.is_authenticated %}
{{ post.moderator.user }}wrote
{% else %}
{{ post.moderator.user }}wrote
{% endif %}
#{{post.category}}</span>
</h4>
"><h4 id="vote_count_{{ post.slug }}">{{ post.get_vote_count }}</h4></span> <br>
<a href="/post/{{ post.slug }}/vote?is_up=0" class="vote">
<span class="glyphicon glyphicon-triangle-bottom col-md-12" aria-hidden="true"></span></a>
</div>
</td>
</table>
#closer
Try this CSS line (if I have correctly understood your problem)
#cell td.vert-align:first-child { width: 40px;}
It will get your td with numbers and td with images closer
Hello I have two contents in my table, so two boxes that contain contents in html. I want to reduce the distance between these two boxes, but I realized size of one box is too big that they are just white space. I'm having trouble reducing that size. can someone please help me with this?
so, cell x and cell y that's in same row to be located closer.
<table class="table">
<tr id="cell">
---------------------------------------------------------------(one cell)
<td class="vert-align">
<div class="voting-space">
<a href="/post/{{ post.slug }}/vote?is_up=1" class="vote">
<span class="glyphicon glyphicon-triangle-top col-md-12" aria-hidden="true"></span></a>
<br />
<span class="col-md-12" style="height:1px; font-family: 'Passion One', cursive; bottom:10px; padding-left:0.01em;
"><h4 id="vote_count_{{ post.slug }}">{{ post.get_vote_count }}</h4></span> <br>
<a href="/post/{{ post.slug }}/vote?is_up=0" class="vote">
<span class="glyphicon glyphicon-triangle-bottom col-md-12" aria-hidden="true"></span></a>
</div>
</td>
--------------------------------------------------------------------(the other cell)
<td class="vert-align">
{% if post.url %}
<h4 id="line">
<img src="{{post.image}}" height="85" width="85"/><span id="title-font">{{ post.title }}</span>
<span style="margin-left: 15px;" class="domain">({{ post.domain }})</span>
<span class="discuss" style="color:red;">토론장 입장</span>
<br />
<span class="post-info">{{ post.pub_date | timesince }}전/{{ post.moderator.username }}작성/<i class="fa fa-eye"></i>{{post.views}}/{{post.category}}</span>
</h4>
{% else %}
<h4>{{ post.title }}<span style="margin-left: 15px; "class="domain">({{ post.domain }})</span></h4>
{% endif %}
For controlling "cellpadding" in CSS, you can simply use padding on table cells. E.g. for 10px of "cellpadding":
td {
padding: 10px;
}
For "cellspacing", you can apply the border-spacing CSS property to your table. E.g. for 10px of "cellspacing":
table {
border-spacing: 10px;
border-collapse: separate;
}
This property will even allow separate horizontal and vertical spacing, something you couldn't do with old-school "cellspacing".