How to stop auto enter in css? - css

I'm pretty noob in html and css since I just started. I'm trying to implement something in a creation but I don't know to delete the auto enters in the title.
#import url(https://fonts.googleapis.com/css?family=Fjalla+One);
html{
height: 100%;
}
body{
font-family: 'Fjalla One', sans-serif;
background: linear-gradient(to bottom, #405166 0%, #656f6f 100%);
}
.container{
margin: auto;
}
h1{
text-transform: uppercase;
font-size: 42px;
line-height: 47px;
letter-spacing: 2px;
text-shadow: #533d4a 1px 1px, #533d4a 2px 2px, #533d4a 3px 3px, #533d4a 4px 4px;
text-align: center;
}
.title{
transform: translateX(-50%) rotate(-5deg);
display: block;
margin-left:50%;
}
<body>
<section class="container">
<h1>
<br />
<span class="title" style="color:#e55643;">Burger</span>
<span class="title" style="color:#2b9f5e;">school</span>
<span class="title" style="color:#f1c83c;">afspraken</span>
</h1>
</section>
</body>
I'd like to have burger and school next to each other without deleting the colors.
enter image description here

.title { display: block } is causing the elements to break into new lines. Using display: inline-block will allow you to rotate the element while keeping them on the same line.
.title{
transform: rotate(-5deg);
display: inline-block;
}
Additional reading: https://css-tricks.com/almanac/properties/d/display/
#import url(https://fonts.googleapis.com/css?family=Fjalla+One);
html{
height: 100%;
}
body{
font-family: 'Fjalla One', sans-serif;
background: linear-gradient(to bottom, #405166 0%, #656f6f 100%);
}
.container{
margin: auto;
}
h1{
text-transform: uppercase;
font-size: 42px;
line-height: 47px;
letter-spacing: 2px;
text-shadow: #533d4a 1px 1px, #533d4a 2px 2px, #533d4a 3px 3px, #533d4a 4px 4px;
text-align: center;
}
.title{
transform: rotate(-5deg);
display: inline-block;
}
<body>
<section class="container">
<h1>
<br />
<span class="title" style="color:#e55643;">Burger</span>
<span class="title" style="color:#2b9f5e;">school</span>
<span class="title" style="color:#f1c83c;">afspraken</span>
</h1>
</section>
</body>

try this,... not sure this is what you wanted
<body>
<section class="container">
<h1>
<br />
<span class="title" >
<label style="color:#e55643;">Burger</label>
<label style="color:#2b9f5e;">school</label>
</span>
<span class="title" style="color:#f1c83c;">afspraken</span>
</h1>
</section>
</body>
////////to remove space between labels do this.
<body>
<section class="container">
<h1>
<br />
<span class="title" >
<label style="color:#e55643;">Burger</label><label style="color:#2b9f5e;">school</label>
</span>
<span class="title" style="color:#f1c83c;">afspraken</span>
</h1>
</section>
remove the space between label it should be on same line without space

<h1>
<br />
<span class="title" style="color:#e55643;">Burger</span><span class="title" style="color:#2b9f5e;">school</span><span class="title" style="color:#f1c83c;">afspraken</span>
you will have no gap between them now :)
just write the spans in the same line, not on different lines
let me know if this works

Related

How do i align 3 elements with bootstrap 4 according to my designs?

I apply the rules of bootstrap but my buttons seems to go out of its alignment. my "Buy Now" and "View More" buttons should be place at the right side of the each sections. But i can seems to make it with bootstrap. I do not want to use Css to align it because i wanted it to be responsive. Can anyone enlighten me to help me out with my issues?
below here are my codes
<div class="container">
<div class="row" id="myDIV">
<?php
$sql = "SELECT * FROM products";
$query = $conn->query($sql);
if (!mysqli_num_rows($query)) {
echo '
<div class="col-12">
<div class="badge badge-danger">No Products Found</div>
</div>
';
} else {
while ($row = $query->fetch_assoc()) {
?>
<section id="product-display" style="z-index: 1;background: linear-gradient(180deg, <?php echo $row['product_section_colour']; ?> 25.52%, rgba(42, 86, 147, 0) 100%);">
<div class="container-fluid">
<div class="row">
<div class="col-2" style="top:-15px; left:-20px;">
<img style="height: 160px;width: 105px;left: -2px;top: -15px;border-radius: 0px;" loading="lazy" loading="lazy" id="product_img" src="images/product-main/<?php echo $row['product_photo']; ?>" alt="">
</div>
<div class="col-6 text-justify" style="position: absolute;height: 68px;left: 22%;right: 27.05%;">
<p style="color:<?php echo $row['product_dec_colour']; ?>;font-size:20px; padding-bottom:2px;font-weight: 600;"><?php echo $row['product_title']; ?></p>
<ul>
<li style="color:<?php echo $row['product_dec_colour']; ?>;font-size:7px;position: absolute;height: 68px;top: 35px;line-height: 8px;font-weight: 400;"><?php echo $row['product_desc']; ?></li>
</ul>
</div>
<div class="col-4">
Buy Now
View More
</div>
</div>
</div>
</section>
<?php
}
}
?>
</div>
this are my css
.buynow {
min-height: 32px;
background: #ffffff;
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.25);
border-radius: 5px;
font-family: Inter;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 15px;
text-align: center;
width: 90px;
position: absolute;
top: 17px;
}
.viewmore {
min-height: 32px;
background: #ffffff;
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.25);
border-radius: 5px;
font-family: Inter;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 15px;
text-align: center;
width: 90px;
position: absolute;
top: 58px;
}
section {
height: 107px;
width: 100%;
left: 0px;
top: 0px;
border-radius: 0px;
display: inline-block;
}
* {
padding: 0px;
margin: 0px;
}
ul li {
list-style-position: outside;
margin-left: 1em;
}
Why did you made "col-6" class as position:absolute? it will work if you remove that. you have used col-2,col-6,col-4 this is enough no need of position: absolute
I cannot run your code, but you can try with flex. Here is an example
<div class="d-flex">
<div class="col-4 mf-auto">
Buy Now
View More
</div>
</div>
You need to add mf-auto to your css file too.
This will help to align your content to the right side
.mf-auto {
margin-left: auto;
}

How can I make an image take 100% width in smaller screens?

I am making an news blog. I have created my main article cards. The cards have an image to the left of the card, and with the card having the main content like the title, brief description, author and date.
Everything works when the browser is maximized (I'm on a 13 inch laptop). As I start resizing my browser and making it smaller, everything starts to kind of break. The image does not take up the full width, and has a lot of white space to the right of it.
I tried giving the image width of 100%, but it does not seem to fix the problem. I am not sure what is wrong and why this is happening. This is only happening to these article cards. Everything else on the homepage works correctly even on smaller sized screens.
If you have some time, can you explain what is happening, and how to solve this problem? Please and thank you.
Screenshots:
Large+ Screens
As I start resizing the browser window and making it smaller it does this:
And finally the phone sized screens:
HTML
<div class="card card-article">
<div class="row no-gutters right-shadow-games">
<div class="col-auto">
<img alt="" class="img-fluid" src="//placehold.it/200x200"> <a class="article-tag games" href="#">Games</a>
</div>
<div class="col">
<div class="card-block">
<div class="row">
<div class="col-md-12">
<h4 class="card-title">How Did van Gogh’s Turbulent Mind Depict One of the Most Complex Concepts in Physics?</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="card-description">Pick the yellow peach that looks like a sunset with its red, orange, and pink coat skin, peel it off with your teeth. Sink them into unripened...</p>
</div>
</div>
<div class="row">
<div class="col-md-9">
<p class="card-author">Author on Sep 29, 2017</p>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
.card-article {
margin-top: 2px;
margin-bottom: 5px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.card-article .card-title{
margin-top: 15px;
margin-left: 15px;
margin-right: 10px;
font-size: 18px;
}
.card-article .card-author{
margin-left: 15px;
margin-right: 10px;
color: #8d8d8d;
font-size: 12px;
line-height: 1.4;
}
.card-article .card-title a{
color: black;
font-weight: 600;
}
.card-article .card-description{
margin-left: 15px;
margin-right: 10px;
color: #8d8d8d;
font-size: 14px;
line-height: 1.4;
}
For give the messy CSS I could definitely clean it up a little bit.
Here, the image will resized to 100% width at 640px media width. I think it is better when you could change the image size to something bigger (as per 100% width point) to get maximum picture clarity.
.card-article {
margin-top: 2px;
margin-bottom: 5px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.card-article .card-title {
margin-top: 15px;
margin-left: 15px;
margin-right: 10px;
font-size: 18px;
}
.card-article .card-author {
margin-left: 15px;
margin-right: 10px;
color: #8d8d8d;
font-size: 12px;
line-height: 1.4;
}
.card-article .card-title a {
color: black;
font-weight: 600;
}
.card-article .card-description {
margin-left: 15px;
margin-right: 10px;
color: #8d8d8d;
font-size: 14px;
line-height: 1.4;
}
.article-tag.games {
position: absolute;
left: 10px;
top: 10px;
background: red;
padding: 2px 5px;
color: white;
border-radius: 4px;
}
.col-auto img {
max-width:200px;
}
#media (max-width: 640px) {
.col-auto {
width:100%;
max-width:100% !important;
}
.col-auto img {
width:100%;
max-width:100%;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<div class="card card-article">
<div class="row no-gutters right-shadow-games">
<div class="col-auto">
<img alt="" class="img-fluid" src="//placehold.it/640x640"> <a class="article-tag games" href="#">Games</a>
</div>
<div class="col">
<div class="card-block">
<div class="row">
<div class="col-md-12">
<h4 class="card-title">How Did van Gogh’s Turbulent Mind Depict One of the Most Complex Concepts in Physics?</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="card-description">Pick the yellow peach that looks like a sunset with its red, orange, and pink coat skin, peel it off with your teeth. Sink them into unripened...</p>
</div>
</div>
<div class="row">
<div class="col-md-9">
<p class="card-author">Author on Sep 29, 2017</p>
</div>
</div>
</div>
</div>
</div>
</div>
What's happening is your image is exactly 200x200px, so it can't stretch when your page changes shape. You could find a different image (I don't recommend this - just putting it out there), or you could try adding a media query for another stylesheet on variable width devices, then resetting the height/width on those.
Use col-md-4 to image wrap div instead col-auto (see fidlle:https://jsfiddle.net/yemd0qnt/3/)
.card-article {
margin-top: 2px;
margin-bottom: 5px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.card-article .card-title{
margin-top: 15px;
margin-left: 15px;
margin-right: 10px;
font-size: 18px;
}
.card-article .card-author{
margin-left: 15px;
margin-right: 10px;
color: #8d8d8d;
font-size: 12px;
line-height: 1.4;
}
.card-article .card-title a{
color: black;
font-weight: 600;
}
.card-article .card-description{
margin-left: 15px;
margin-right: 10px;
color: #8d8d8d;
font-size: 14px;
line-height: 1.4;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<div class="card card-article">
<div class="row no-gutters right-shadow-games">
<div class="col-md-4">
<img alt="" class="img-fluid" src="//placehold.it/200x200"> <a class="article-tag games" href="#">Games</a>
</div>
<div class="col">
<div class="card-block">
<div class="row">
<div class="col-md-12">
<h4 class="card-title">How Did van Gogh’s Turbulent Mind Depict One of the Most Complex Concepts in Physics?</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="card-description">Pick the yellow peach that looks like a sunset with its red, orange, and pink coat skin, peel it off with your teeth. Sink them into unripened...</p>
</div>
</div>
<div class="row">
<div class="col-md-9">
<p class="card-author">Author on Sep 29, 2017</p>
</div>
</div>
</div>
</div>
</div>
</div>
You can 100% image width with use Media Queries for mobile.
#media (max-width: 575px) {
.img-fluid{width:100%;}
}

cannot set the button border property using css

Come to a strange problem, when I use css to set the button, I can set its color, font-size, background, but cannot set its border. The following is HTML and CSS code.
.btn-general {
border-width: 2px !important;
border-style: solid !important;
border-radius: 0;
padding: 12px 26px 12px 26px;
font-size: 16px;
font-weight: 400;
text-transform: uppercase !important;
}
.btn-white {
border-color: #fff;
color: #fff;
}
<section id="home">
<div id="home-cover">
<div id="home-content-box">
<div id="home-content-box-inner">
<div id="home-heading">
<h3>Watch Out<br>The Modern Responsive Website!</h3>
</div>
<div id="home-btn">
<a type="button" class="btn btn-lg btn-general btn-white" href="#work" title="View Our Work">View Our Work</a>
</div>
</div>
</div>
</div>
</section>
Put your css in Style Tag
<style>
.btn-general{
border-width:2px !important;
border-style: solid !important;
border-radius: 0;
padding: 12px 26px 12px 26px;
font-size: 16px;
font-weight: 400;
text-transform: uppercase !important;
}
.btn-white{
border-color: #fff;
color: #fff;
}
</style>
always put CSS on the top of html
<div id="home-cover">
<div id="home-content-box">
<div id="home-content-box-inner">
<div id="home-heading">
<h3>Watch Out<br>The Modern Responsive Website!</h3>
</div>
<div id="home-btn">
<a type="button" class="btn btn-lg btn-general btn-white" href="#work" title="View Our Work">View Our Work</a>
</div>
</div>
</div>
</div>
</section>
You have set your border-color to white that's why you could not see that. I have changed it to darker color so that you can see it.
.btn-general{
border-width:2px !important;
border-style: solid !important;
border-color: #ff3333;
border-radius: 0;
padding: 12px 26px 12px 26px;
font-size: 16px;
font-weight: 400;
text-transform: uppercase !important;
}
.btn-white{
color: #222;
border-color: #222;
}
<section id="home">
<div id="home-cover">
<div id="home-content-box">
<div id="home-content-box-inner">
<div id="home-heading">
<h3>Watch Out<br>The Modern Responsive Website!</h3>
</div>
<div id="home-btn">
<a type="button" class="btn btn-lg btn-general btn-white" href="#work" title="View Our Work">View Our Work</a>
</div>
</div>
</div>
</div>
</section>
Hope this helps

How to get an image and H1 on the same line

I have a logo (figure) for a website that I need to put on the same line as the h1 heading. Does anyone have suggestions? Here is something I recently tried:
figure {
float: left;
padding-left: 2px;
}
h1 {
text-align: center;
border: 3px solid: #FFA500;
border-radius: 15px;
box-shadow: 5px 5px 5px #828282;
}
header {
text-align: center;
letter-spacing: 1px;
height: 8em;
padding: 2em 10%;
}
<title>Kumquats</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div id="wrapper">
<header>
<figure>
<a href="index.html">
<img src="img/kumquatlogo.gif" alt="kumquat logo" width="75" height="75">
</figure>
</a>
<h1>Kumquat Central</h1>
I want a logo image to be at the top of a webpage, next to an h1 element of text. The figure and the h1 are contained inside of a header, that is why I have header code there.
You also can try the following:
HTML:
<header>
<a href="index.html">
<img src="http://placeholder.cn/128/aaa" alt="kumquat logo" class="figure">
</a>
<h1>Kumquat Central</h1>
</header>
Then your CSS stylesheet. Also fixed your h1 border parameter that had errors.
h1 {
display: inline;
text-align: center;
border: 3px solid #FFA500;
border-radius: 15px;
box-shadow: 5px 5px 5px #828282;
}
header {
text-align: center;
letter-spacing: 1px;
height: 8em;
padding: 2em 10%;
}
.figure {
vertical-align:middle;
}
Since you did not share your html, here is a good way to do it https://jsfiddle.net/u97rggyy/5/
Actually this question should be marked as a duplicate of Vertically align text next to an image?
HTML
<!-- Case 1) text height is bigger than image height -->
<div>
<img class="img-valign" src="http://www.placehold.it/30x30" alt="" />
<span class="text1">some text1</span>
<img class="img-valign" src="http://www.placehold.it/20x20" alt="" />
<span class="text1">some text1</span>
</div>
<br/><br/><br/>
<!-- Case 2) image height is bigger than text height -->
<div>
<img class="img-valign" src="http://www.placehold.it/50x50" alt="" />
<span class="text2">some text2</span>
<img class="img-valign" src="http://www.placehold.it/70x70" alt="" />
<span class="text2">some text2</span>
</div>
CSS
.img-valign {
vertical-align: middle;
margin-bottom: 0.75em;
}
.text1 {
font-size: 44px;
}
.text2 {
font-size: 24px;
}

Link text still underlined when "text-decoration: none" is applied

I am working on a page in Drupal 7 in which I have a number of boxes with text and a photo inside of them. I have the entire box div linking to its content page, but I can't seem to get rid of the underline.
I have tried applying text-decoration: none; to every class inside of and outside of the box and the text inside the box is still underlined.
Even when I use developer tools/'inspect element' tool in Google it shows that the computed style for the box and the text within is text-decoration: none;
I have been trying to figure this out off and on for about a day now and I have not been able to find any solutions via Google.
Any ideas?
Thanks in advance.
Edit: I am working to post my code. I am trying to find a good solution for posting because it is a page within Drupal that is rendering through Views. Also, I have a job interview in an hour that I'm getting ready for. I probably should have waited until after the interview to post this issue.. oh well.
Edit x2: My HTML is as follows:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" version="XHTML+RDFa 1.0" dir="ltr" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" class="js"><head profile="http://www.w3.org/1999/xhtml/vocab">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Drupal 7 (http://drupal.org)">
<title>Portfolio Page | mywebsite.com</title>
<style type="text/css" media="all">#import url("http://url.com/modules/system/system.base.css?m178g6");
#import url("http://url.com/modules/system/system.menus.css?m178g6");
#import url("http://url.com/modules/system/system.messages.css?m178g6");
#import url("http://url.com/modules/system/system.theme.css?m178g6");</style>
<style type="text/css" media="all">#import url("http://url.com/misc/ui/jquery.ui.core.css?m178g6");
#import url("http://url.com/misc/ui/jquery.ui.theme.css?m178g6");
#import url("http://url.com/modules/overlay/overlay-parent.css?m178g6");</style>
<style type="text/css" media="all">#import url("http://url.com/modules/comment/comment.css?m178g6");
#import url("http://url.com/modules/field/theme/field.css?m178g6");
#import url("http://url.com/modules/node/node.css?m178g6");
#import url("http://url.com/modules/search/search.css?m178g6");
#import url("http://url.com/modules/user/user.css?m178g6");
#import url("http://url.com/sites/all/modules/views/css/views.css?m178g6");</style>
<style type="text/css" media="all">#import url("http://url.com/sites/all/modules/ctools/css/ctools.css?m178g6");
#import url("http://url.com/sites/all/modules/lightbox2/css/lightbox.css?m178g6");
#import url("http://url.com/sites/all/modules/views_slideshow/views_slideshow.css?m178g6");
#import url("http://url.com/modules/shortcut/shortcut.css?m178g6");
#import url("http://url.com/modules/toolbar/toolbar.css?m178g6");</style>
<style type="text/css" media="all">#import url("http://url.com/sites/all/themes/personal/css/style.css?m178g6");</style>
<style type="text/css" media="print">#import url("http://url.com/sites/all/themes/personal/css/print.css?m178g6");</style>
<style type="text/css" media="mobile">#import url("http://url.com/sites/all/themes/personal/css/mobile.css?m178g6");</style>
<script type="text/javascript" src="http://url.com/misc/jquery.js?v=1.4.4"></script>
<script type="text/javascript" src="http://url.com/misc/jquery.once.js?v=1.2"></script>
<script type="text/javascript" src="http://url.com/misc/drupal.js?m178g6"></script>
<script type="text/javascript" src="http://url.com/misc/ui/jquery.ui.core.min.js?v=1.8.7"></script>
<script type="text/javascript" src="http://url.com/sites/all/modules/views/js/views-contextual.js?m178g6"></script>
<script type="text/javascript" src="http://url.com/misc/jquery.ba-bbq.js?v=1.2.1"></script>
<script type="text/javascript" src="http://url.com/modules/overlay/overlay-parent.js?v=1.0"></script>
<script type="text/javascript" src="http://url.com/misc/jquery.cookie.js?v=1.0"></script>
<script type="text/javascript" src="http://url.com/sites/all/modules/lightbox2/js/lightbox.js?1332273397"></script>
<script type="text/javascript" src="http://url.com/sites/all/modules/views_slideshow/js/views_slideshow.js?m178g6"></script>
<script type="text/javascript" src="http://url.com/modules/toolbar/toolbar.js?m178g6"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"personal","theme_token":"0CkOwyp1neNP-2IbE8LYCgYGBJ9sz39ORy5DodizAGg","js":{"misc\/jquery.js":1,"misc\/jquery.once.js":1,"misc\/drupal.js":1,"misc\/ui\/jquery.ui.core.min.js":1,"sites\/all\/modules\/views\/js\/views-contextual.js":1,"misc\/jquery.ba-bbq.js":1,"modules\/overlay\/overlay-parent.js":1,"misc\/jquery.cookie.js":1,"sites\/all\/modules\/lightbox2\/js\/lightbox.js":1,"sites\/all\/modules\/views_slideshow\/js\/views_slideshow.js":1,"modules\/toolbar\/toolbar.js":1},"css":{"modules\/system\/system.base.css":1,"modules\/system\/system.menus.css":1,"modules\/system\/system.messages.css":1,"modules\/system\/system.theme.css":1,"misc\/ui\/jquery.ui.core.css":1,"misc\/ui\/jquery.ui.theme.css":1,"modules\/overlay\/overlay-parent.css":1,"modules\/comment\/comment.css":1,"modules\/field\/theme\/field.css":1,"modules\/node\/node.css":1,"modules\/search\/search.css":1,"modules\/user\/user.css":1,"sites\/all\/modules\/views\/css\/views.css":1,"sites\/all\/modules\/ctools\/css\/ctools.css":1,"sites\/all\/modules\/lightbox2\/css\/lightbox.css":1,"sites\/all\/modules\/views_slideshow\/views_slideshow.css":1,"modules\/shortcut\/shortcut.css":1,"modules\/toolbar\/toolbar.css":1,"sites\/all\/themes\/personal\/css\/style.css":1,"sites\/all\/themes\/personal\/css\/print.css":1,"sites\/all\/themes\/personal\/css\/mobile.css":1}},"lightbox2":{"rtl":0,"file_path":"\/(\\w\\w\/)public:\/","default_image":"\/sites\/all\/modules\/lightbox2\/images\/brokenimage.jpg","border_size":10,"font_color":"000","box_color":"fff","top_position":"","overlay_opacity":"0.8","overlay_color":"000","disable_close_click":true,"resize_sequence":0,"resize_speed":400,"fade_in_speed":400,"slide_down_speed":600,"use_alt_layout":false,"disable_resize":false,"disable_zoom":false,"force_show_nav":false,"show_caption":true,"loop_items":false,"node_link_text":"View Image Details","node_link_target":false,"image_count":"Image !current of !total","video_count":"Video !current of !total","page_count":"Page !current of !total","lite_press_x_close":"press \u003Ca href=\u0022#\u0022 onclick=\u0022hideLightbox(); return FALSE;\u0022\u003E\u003Ckbd\u003Ex\u003C\/kbd\u003E\u003C\/a\u003E to close","download_link_text":"Download Original","enable_login":false,"enable_contact":false,"keys_close":"c x 27","keys_previous":"p 37","keys_next":"n 39","keys_zoom":"z","keys_play_pause":"32","display_image_size":"","image_node_sizes":"()","trigger_lightbox_classes":"","trigger_lightbox_group_classes":"","trigger_slideshow_classes":"","trigger_lightframe_classes":"","trigger_lightframe_group_classes":"","custom_class_handler":0,"custom_trigger_classes":"","disable_for_gallery_lists":true,"disable_for_acidfree_gallery_lists":true,"enable_acidfree_videos":true,"slideshow_interval":5000,"slideshow_automatic_start":true,"slideshow_automatic_exit":true,"show_play_pause":true,"pause_on_next_click":false,"pause_on_previous_click":true,"loop_slides":false,"iframe_width":600,"iframe_height":400,"iframe_border":1,"enable_video":false},"overlay":{"paths":{"admin":"node\/*\/edit\nnode\/*\/delete\nnode\/*\/revisions\nnode\/*\/revisions\/*\/revert\nnode\/*\/revisions\/*\/delete\nnode\/add\nnode\/add\/*\noverlay\/dismiss-message\nuser\/*\/shortcuts\nadmin\nadmin\/*\nbatch\ntaxonomy\/term\/*\/edit\nuser\/*\/cancel\nuser\/*\/edit\nuser\/*\/edit\/*","non_admin":"admin\/structure\/block\/demo\/*\nadmin\/reports\/status\/php"},"ajaxCallback":"overlay-ajax"},"tableHeaderOffset":"Drupal.toolbar.height"});
//--><!]]>
</script>
</head>
<body class="html not-front logged-in no-sidebars page-portfolio toolbar toolbar-drawer lightbox-processed" style="padding-top: 65px; ">
<div id="skip-link">
Skip to main content
</div>
<div id="overlay-disable-message" class="clearfix"><h3 class="element-invisible">Options for the administrative overlay</h3>If you have problems accessing administrative pages on this site, disable the overlay on your profile page. Dismiss this message.</div><div id="toolbar" class="toolbar overlay-displace-top clearfix toolbar-processed">
<div class="toolbar-menu clearfix">
<ul id="toolbar-home"><li class="home first last"><span class="home-link">Home</span></li>
</ul> <ul id="toolbar-user"><li class="account first">Hello <strong>user</strong></li>
<li class="logout last">Log out</li>
</ul> <h2 class="element-invisible">Administrative toolbar</h2><ul id="toolbar-menu"><li class="menu-11 path-admin-dashboard first"><span class="icon"></span>Dashboard <span class="element-invisible">(View and customize your dashboard.)</span></li>
<li class="menu-9 path-admin-content"><span class="icon"></span>Content <span class="element-invisible">(Administer content and comments.)</span></li>
<li class="menu-21 path-admin-structure"><span class="icon"></span>Structure <span class="element-invisible">(Administer blocks, content types, menus, etc.)</span></li>
<li class="menu-7 path-admin-appearance"><span class="icon"></span>Appearance <span class="element-invisible">(Select and configure your themes.)</span></li>
<li class="menu-18 path-admin-people"><span class="icon"></span>People <span class="element-invisible">(Manage user accounts, roles, and permissions.)</span></li>
<li class="menu-16 path-admin-modules"><span class="icon"></span>Modules <span class="element-invisible">(Extend site functionality.)</span></li>
<li class="menu-8 path-admin-config"><span class="icon"></span>Configuration <span class="element-invisible">(Administer settings.)</span></li>
<li class="menu-19 path-admin-reports"><span class="icon"></span>Reports <span class="element-invisible">(View reports, updates, and errors.)</span></li>
<li class="menu-12 path-admin-help last"><span class="icon"></span>Help <span class="element-invisible">(Reference for usage, configuration, and modules.)</span></li>
</ul> Hide shortcuts </div>
<div class="toolbar-drawer clearfix">
<div class="toolbar-shortcuts"><ul class="menu"><li class="first leaf">Add content</li>
<li class="leaf">Find content</li>
<li class="leaf">Performance</li>
<li class="last leaf">Maintenance mode</li>
</ul></div>Edit shortcuts </div>
</div>
<!-- If front page, present front page content -->
<div id="a">
<!-- Begin other page specific content -->
<div id="smallhead">
</div>
</div><!-- End div a-->
<!-- Begin menu -->
<div id="b">
<div id="menu">
<div class="item">Home</div>
<div class="item">About Me</div>
<div class="item">Portfolio</div>
<div class="item">Photos</div>
<div class="item">Projects</div>
<div class="item">Blog</div>
</div>
</div>
<div id="c">
<div id="middle">
<!-- Begin other page specific content -->
<div id="contentwrapper">
<div class="region region-content">
<div id="block-system-main" class="block block-system">
<div class="content">
<div class="view view-portfolio-page view-id-portfolio_page view-display-id-page view-dom-id-a0c892fe2818834f0a7750c98e7e6688">
<div class="view-content">
<div class="views-row views-row-1 views-row-odd views-row-first">
<div> <div><a href="/node/10">
<div class="smallbox">
<div class="nounderline">
<strong>Postcards</strong><br>
<img typeof="foaf:Image" src="" width="233" height="157" alt=""><br>
Postcards<br>
Adobe Illustrator
</div>
</div></a></div> </div> </div>
<div class="views-row views-row-2 views-row-even">
<div> <div><a href="/node/9">
<div class="smallbox">
<div class="nounderline">
<strong>Design</strong><br>
<img typeof="foaf:Image" src="" width="233" height="157" alt=""><br>
Desiugn<br>
Adobe Illustrator
</div>
</div></a></div> </div> </div>
<div class="views-row views-row-3 views-row-odd">
<div> <div><a href="/node/8">
<div class="smallbox">
<div class="nounderline">
<strong>Website</strong><br>
<img typeof="foaf:Image" src="" width="233" height="157" alt="screenshot"><br>
Awareness Campaign<br>
HTML, CSS
</div>
</div></a></div> </div> </div>
<div class="views-row views-row-4 views-row-even views-row-last">
<div> <div><a href="/node/7">
<div class="smallbox">
<div class="nounderline">
<strong>Website</strong><br>
<img typeof="foaf:Image" src="" width="233" height="157" alt=""><br>
Details Website<br>
HTML 5, CSS 3
</div>
</div></a></div> </div> </div>
</div>
</div> </div>
</div>
</div>
</div>
<!-- End other page specific content -->
</div><!--end middle-->
</div>
<div id="d">
<div id="footer">
;Contact Form
<br>
Copyright ©2012 My Name
</div>
</div>
<div id="lightbox2-overlay" style="display: none; "></div> <div id="lightbox" style="display: none;" class="lightbox2-orig-layout"> <div id="outerImageContainer" style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); "><div id="modalContainer" style="display: none; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; "></div><div id="frameContainer" style="display: none; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; "></div><div id="imageContainer" style="display: none; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; "><img id="lightboxImage" alt=""><div id="hoverNav"><a id="prevLink" title="Previous" href="#" style="padding-top: 10px; "></a><a id="nextLink" title="Next" href="#" style="padding-top: 10px; "></a></div></div><div id="loading"></div></div> <div id="imageDataContainer" class="clearfix" style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); "> <div id="imageData"><div id="imageDetails"><span id="caption"></span><span id="numberDisplay"></span></div><div id="bottomNav"><div id="frameHoverNav"><a id="framePrevLink" title="Previous" href="#" style="padding-top: 10px; "></a><a id="frameNextLink" title="Next" href="#" style="padding-top: 10px; "></a></div><a id="bottomNavClose" title="Close" href="#" style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); "></a><a id="bottomNavZoom" href="#"></a><a id="bottomNavZoomOut" href="#"></a><a id="lightshowPause" title="Pause Slideshow" href="#" style="display: none;"></a><a id="lightshowPlay" title="Play Slideshow" href="#" style="display: none;"></a></div></div> </div> </div></body></html>
And my CSS is as follows:
#charset "utf-8";
/* CSS Document */
body{
background: black;
font-size: 14px;
margin: 0;
}
a:visited{
color: blue;
}
h2{
font-size: 135%;
margin: .2em 0;
}
#a{
width: 100%;
background: rgb(140,79,84);
}
#bighead{
height: 31em;
width: 69em;
margin: 0 auto;
padding-top: 2em;
background: url(../img/headerpic.jpg);
text-align: center;
border: 0 solid black;
border-width: 0 4px;
}
#header a{
font-size: 35px;
text-decoration: none;
color: black;
}
#slogan{
font-size: 18px;
padding: .5em;
}
#smallhead{
height: 14em;
width: 69em;
margin: 0 auto;
background: url(../img/smallheader.jpg);
text-align: center;
border: 0 solid black;
border-width: 0 4px;
}
#b{
width: 100%;
background: rgb(50,51,46);
}
#menu{
width: 69em;
height: 2.5em;
border: 0 solid black;
border-width: 0 4px;
background: black;
text-align: center;
margin: 0 auto;
}
.item{
font-size: 17.5px;
height: 1.1em;
width: 9.2em;
float: left;
padding: .3em 0;
border-top: .2em solid rgb(31,38,28);
border-bottom: .2em solid rgb(31,38,28);
}
#menu a:link, a:visited{
text-decoration: none;
color: #CCC;
}
#menu a:hover{
color: white;
background: white;
text-decoration: underline;
}
#c{
width: 100%;
background: rgb(139,124,108);
}
#middle{
min-height: 22.5em;
width: 67.6em;
margin: 0 auto;
border: 0 solid black;
border-width: 0 4px;
background: rgb(98,103,109);
padding: .75em;
text-decoration: none;
}
.title{
font-size: 2em;
height: .5em;
width: 24em;
padding-left: 1em;
padding-bottom: .25em;
color: white;
}
.box{
float: left;
height: 17em;
width: 17em;
padding: 1em;
padding-top: .5em;
margin: 1.5em;
background: rgb(49,49,51);
color: white;
}
#contentwrapper{
}
#d{
width: 100%;
background: black;
}
#footer{
height: 2.5em;
width: 69em;
margin: 0 auto;
background: black;
text-align: center;
color: white;
}
.smallbox{
float: left;
height: 15em;
width: 17em;
padding: 1em;
padding-top: .5em;
margin: 1.5em;
background: rgb(49,49,51);
color: white;
text-align: center;
text-decoration: none;
}
.smallbox img{
padding: .2em 0;
}
.nounderline{
text-decoration: none;
}
Since this was the first google result and didn't solve my issue: Check the anchor states, as it might need to be set in one of the others. (https://www.w3schools.com/css/css_pseudo_classes.asp)
a,
a:link,
a:visited,
a:hover,
a:active{
text-decoration: none;
}
To apply just to this view add:
.view-portfolio-page .views-row a { text-decoration: none; }
To apply to all views add:
.views-row a { text-decoration: none; }
http://jsfiddle.net/D8kRE/
You were applying text-decoration: none to a div which has no effect. You can only apply that to an anchor tag which in your case is located at .views-row a. You can get more specific and apply this to only the portfolio page view by using the code I've put above.
If you are refering to the underline on the text, remember to set the text-decoration property to none on the ELEMENT. E.g.
<html>
<head></head>
<body>
<div>
Google
</div>
</body>
Edit: Note, it is bad to use styling in-line with elements, I used it, just to demonstrate a solution.
Instead of font-decoration: none; try the css text-decoration: none;
As this hasn't actually got a definitive answer yet and it's fairly high up on Google searches. I thought I would chip in with my answer.
I just had a similar problem where I couldn't pinpoint why I wasn't able to get rid of the underline and found out that it was because I didn't specify the hover state.
So try out
#header a:hover {
text-decoration: none;
}
And that should work. I know this was posted ages ago, but I have seen that you haven't accepted an answer and didn't post whether you sorted it or not. So hopefully my input will help someone along the way and hopefully you can see this and finally accept an answer or make your own.
I know this is old, but this came upon my search as well. So I thought I'd share.
I had a similar problem. I created a regular nav and setting the text-decoration to none worked fine.
Then I had to amend my css to create a hamburger menu effect for smaller viewports. And although I used the exact same css, the underline appeared and nothing I did would make it go away. I know it has something to do with the toggle:checked & ~.mainNav feature under which my nav needed to be placed, but I couldn't figure out why and how to get around it.
In any case, the one thing that DID work was going into my reset, and adding a default: a {text-decoration: none}
Don't know why it worked, but it did. Hope this helps someone.
I ran into this problem and found it was "box-shadow." See if you are lucky enough with these styles:
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
This doesn't appear to be a text-decoration: issue. It actually appears to be an issue with border-bottom:
Please check the instance of border-bottom in:
.item{
font-size: 17.5px;
height: 1.1em;
width: 9.2em;
float: left;
padding: .3em 0;
border-top: .2em solid rgb(31,38,28);
border-bottom: .2em solid rgb(31,38,28);
}
try to add !important
text-decoration: none !important;
text-decoration works on anchor, it's correct name would be: anchor-decoration-for-text.

Resources