we can see lot of empty space in link as below the image. I want to hide those empty space.
.main {
margin: 0 auto;
width: 1000px;
}
body, button, input, select, table, textarea {
font-family: 'Roboto Condensed', sans-serif;
color: #636363;
font-size: 14px;
line-height: 1.5;
}
html
<div class="custom_case">
<div class="custom_case_left">
<h1 class="cc1">Custom Cases</h1>
<h2 class="cc2">Make Your Own design</h2>
</div>
<?php
$brandSelect = '<select id="brand_select">';
$brandSelect .= '<option value="">My Brand</option>';
$brandSelect .= '</select>';
echo '<select id="model_select"><option value="">My Model</option></select>';
?>
<div class ="cc3">
<div class ="cc4">
<span class ="cc5"> See Cases > </span>
</div>
</div>
I dont want to give so much empty space between image and below footer
please help me for this.
Thanks in advance.
Figured it out for you!
Your image of the phone cases is what is causing the space issue.
.custom_case_right img {
/*float:right;*/
/*bottom:320px;*/
}
That will fix the spacing beneath your image. Now your image is displaying improperly and to fix do this
.custom_case_right {
float:right;
margin-top:-310px;
}
These two changes ought to take care of it for you. I tested this out in Chrome.
You'll still need to think about how you want to have your image behave as your viewport shrinks though.
trying to make img:
line-height: 0;
vertical-align: top or bottom;
You have to fix the height of main-container.
enter code here.main-container{
height:550px;
}
Make this changes to your classes:
.col1-layout .col-main {
position: relative;
}
.custom_case_right {
float: left;
position: absolute;
top: 0;
bottom: 0;
right: 0;
}
And in your image remove position absolute, add this style instead:
.custom_case_right img {
position: relative;
width: 620px;
height: 100%;
}
Related
EDIT:
I came across this code:
add_filter( 'woocommerce_attribute_label', 'custom_attribute_label', 10, 3 );
function custom_attribute_label( $label, $name, $product ) {
$taxonomy = 'attribute_pa_'.$name;
if( $taxonomy == 'attribute_pa_staat' )
$label = $label . ' info<i class="fa fa-question"></i> ' );
return $label;
}
But it doesn't work (yet) how can I make it work?
See the page I'm trying this on here:
https://dev.pctoppers.nl/product/dell-latitude-e5550-refurbished/
End of edit
I'm trying to create an icon with a specific ID so I can link a popup to it.
I want to do this with a ::after pseudo element (if possible). We have products with different grades that we want to add an extra explanation to.
This is the code I've tried:
[data-value="a-grade"]::after {
content:"\f05a\f05a";
font-family: "Font Awesome 6 Duotone"!important;
padding:0px!important;
margin:0px!important;}
This unfortunately doesn't work and puts the icon behind the text instead of on-top of the small window its in. See screenshot below
The most ideal look would be this:
The blue circle being the icon.
Is there any way of achieving this? Keep in mind that it needs its own #ID so I can link a popup.
Thanks in advance!
With CSS property position (absolute and relative) you can make it.
.w {
width: 400px;
height: 100px;
background: lightblue;
position: relative;
}
.txt {
padding:10px;
}
/* Top right text */
.top-right {
font-size:2rem;
position: absolute;
top: -5px;
right: -5px;
background: red;
border-radius:40px;
height:10px;
width:10px;
}
<div class="w">
<div class="top-right">*</div>
<div class="txt">text</div>
</div>
Update with pseudo element
.w {
width: 400px;
height: 100px;
background: lightblue;
position: relative;
}
.txt {
padding:10px;
}
[data-value="a-grade"]::after {
content:"!";
font-family: "Font Awesome 6 Duotone"!important;
font-size:2rem;
position: absolute;
top: -15px;
right: -5px;
}
<div class="w" >
<div classs="top-right" data-value="a-grade"></div>
<div class="txt">text</div>
</div>
I am trying to make some information sit next to a side panel I have created using Div's.
I have tried to float the text on the left but this hasn't worked.
Here is what I have
Click here
And this is what I want
Click here
I'll show you my page and the style sheet I'm using as well :D
Page:
FitnessHub
<div class="SidePanel">
Text
</div>
<div class="WelcomeText">
</div>
<?php
$db = new mysqli("127.0.0.1", "root", "root", "fitnessbooking");
$query= $db->query("select Username from users where Username = '$_POST[username]' and Pass = '$_POST[password]'");
if ($query->num_rows ==1){
echo "";
}
else {
header("Location: http://localhost/pages/login.php?fail=1");
exit;
}
?>
</body>
</html>
Style Sheet:
.SidePanel {
background-color: white;
width: 250px;
height: 100%;
}
.WelcomeText {
Float left;
}
First, be advised that you code is susceptible to SQL injection attacks. You should be using parameterized queries or at least escaping them.
http://php.net/manual/en/security.database.sql-injection.php
Second, float both items left:
.SidePanel { float: left; }
.WelcomeText { float: left; }
You are missing : in your style,
.WelcomeText {
Float: left;
}
You could remove the float:left and add display: inline-block; to both the side-panel and welcome-text classes.
The default display property for a div is block, which means it would be forced below the sidePanel div.
So a quick way around this is to use the inline-block property.
.SidePanel {
background-color: white;
width: 250px;
height: 100%;
display: inline-block;
}
.WelcomeText {
display: inline-block;
}
Here is a great explanation of why inline-block is now preferable to float: https://stackoverflow.com/a/15177860/5995092
"A huge benefit of display:inline-block is that when other developers are maintaining your code at a later point, it is much more obvious what display:inline-block and text-align:right is trying to accomplish than a float:left or float:right statement." - Alex W.
Building my first website, and learning HTML, CSS, PHP, MySQL as needed. I'd like a set of inline divs which are aligned to the left. However, if there's not enough room to fill the screen, I'd like for the entire block of inline divs to be centered. After much searching and research, I determined it was impossible with only CSS, due to the fact that the internal size of all the inline left aligned divs would have to be calculated before the auto margin of the centered containing div could be calculated. I ended up kludging it together with the use of a whole bunch of invisible inline "ghost" divs which make the last line of the inline divs appear as if it's left-aligned.
Now it looks like this, which is great. http://i.stack.imgur.com/Zmru7.png
I gave the fake divs a border, and now they're visible. http://i.stack.imgur.com/Zmru7.png
Firstly, is there an elegant solution to this aside from media tags which change the CSS depending on screen size? Secondly, is it possible to force it to center when there's only one line?
i.stack.imgur.com/ DjWaj.png
CSS: (stripped, if something seems missing let me know)
div.pmegaframe {
width: 100%;
margin: 0px auto; padding: 0px;
text-align: center; }
div.pfake {
display: inline-block;
vertical-align: top;
overflow: hidden;
margin: 22px; margin-top:0px; margin-bottom:0px;
width: 164px; height: 1;
border: none; }
div.pframe {
display: inline-block;
vertical-align: top;
overflow: hidden;
margin: 15px;
width: 164px;
border: 6px solid var(--header); }
/*div.pframe:hover {
border: 16px solid #B85843; }*/
div.pminiframe {
width: 160px;
margin: 0px; padding: 0px;
border: 2px solid var(--white);
background: var(--dark); }
div.pimageframe {
overflow: hidden;
width: 160px; height: 160px;
color: var(--accent);
background: var(--white); }
div.pwordsframe {
position: relative;
width: 160px; height: 280px; }
index.php (stripped)
<div class="pmegaframe">
<?php
$pquery = mysqli_query($db, "SELECT f_name, l_name, blurb FROM users");
$pnum = mysqli_num_rows($pquery); $id = 0; //Pull userdata
while ($id < $pnum) { //Collect userdata
mysqli_data_seek($pquery, $id); $prow = mysqli_fetch_row($pquery);
$image = "160px_profile_".$id; $name = $prow[0]." ".$prow[1];
$text = $prow[2];
$state = 0; $rating = 1;
$squery = mysqli_query($db, "SELECT ID, courseID FROM subjects WHERE userID=".$id); //Pull the user's subjects
$snum = mysqli_num_rows($squery);
include "pframe.php"; //Makes the userframe
$id += 1;
}
echo str_repeat("<div class=\"pfake\"></div>", 8);
//fills in the grid with invisible boxes
?>
</div>
pframe.php (also stripped):
<div class="pframe"> <!--The base grey outer frame-->
<a href="profile.php?user=<?php print $id?>" class="nocolor"> <!-- links it-->
<div class="pminiframe"> <!-- puts down the interior white frame-->
<div class="pimageframe"> <!--The upper half of the box-->
<img src="/profiles/<?php echo $image; ?>.png" alt="Profile image not found!"></div>
<div class="pwordsframe"> <!--The lower half of the box-->
<!-- *snip* This was the messy content of the lower half of the profile boxes. -->
</div>
</div>
</a>
</div>
Im trying to use padding to push an image 18px from the top of a div. Neither margin or padding are working, and after comparing the two padding seems to be what I want anyway.
The problem is with the footer-middle-left-left-image div tag. The margin on the text one works fine though.
Here's the html:
<div id = "footer-middle-left-left">
<div id = "footer-middle-left-left-picture">
<img src = "" alt = "some_text">
</div>
<div id = "footer-middle-left-left-text">
If you would like to join our newsletter, please enter your </br>
email address below.
</div>
<div id = "footer-middle-left-left-email">
</div>
</div>
The CSS I have is:
#footer-middle-left-left {
float: left;
width: 483px;
height: 175px;
}
#footer-middle-left-left-image {
float: left;
width: 483px;
height: 59px;
padding-top: 18px;
}
#footer-middle-left-left-text {
width: 483px;
height: 58px;
float: left;
margin-left: 25px;
color: white;
}
#footer-middle-left-left-email {
height: 58px;
float: left;
width: 483px;
}
Any help would be appreciated! Also any advice, anything at all would be nice too. I'm pretty new so advice not relevant to my problem is also appreciated, like is this a good id-naming convention, etc..
In html you have footer-middle-left-left-picture but in css #footer-middle-left-left-image
Is it this bug or you just make mistake on paste code?
http://jsfiddle.net/CmwHu/
#footer-middle-left-left-image this id doesnt exist in your html.
So i have changed footer-middle-left-left-picture to #footer-middle-left-left-image.
It is working now
DEMO
In a way this is simple but I have been trying to figure out this for hours now so I decided to write the problem down and maybe with your help I could find a solution.
On layout heading (h1, h2, h3) have a line next to them. Basically somehting like this:
Example Heading--------------------------------------------
Another Example Heading---------------------------------
One more------------------------------------------------------
So that is end result (----- is gfx as background-image). How would you do it? The background color could change and/or have opacity.
One thing what I was thinking would be this:
<h1><span>Example Heading</span></h1>
when the CSS would look lke this:
h1 {
background-image: url(line.png);
}
h1 span {
background: #fff;
}
But since the background color can be something else than white (#fff) that doesn't work.
Hopefully you did understand my problem :D
Hacky but, maybe something like this:
HTML:
<h1>
<span>Test</span>
<hr>
<div class="end"></div>
</h1>
And the css:
h1 span{ float :left; margin-right: 1ex; }
h1 hr {
border: none;
height: 1px;
background-color: red;
position: relative;
top:0.5em;
}
h1 div.end { clear:both; }
Fiddle here
This worked for me.
HTML
<div class="title">
<div class="title1">TITLE</div>
</div>
CSS
.title {
height: 1px;
margin-bottom: 20px;
margin-top: 10px;
border-bottom: 1px solid #bfbfbf;
}
.title .title1 {
width: 125px;
margin: 0 auto;
font-family: Arial, sans-serif;
font-size: 22px;
color: #4c4c4c;
background: #fff;
text-align: center;
position: relative;
top: -12px
}
I don't think you can achieve this with pure css because the heading text could be any length. Here is a dynamic javascript solution which sets the width of the line image based on the width of the heading text.
Click here for jsfiddle demo
html (can be h1, h2 or h3)
<div class="heading-wrapper">
<h1>Example Heading</h1>
<img src="line.png" width="193" height="6" alt="" />
</div>
css
h1{font-size:16px}
h2{font-size:14px}
h3{font-size:12px}
h1,h2,h3{margin:0;padding:0;float:left}
.heading-wrapper{width:300px;overflow-x:hidden}
.heading-wrapper img{
float:right;padding-top:9px;
/*ie9: position:relative;top:-9px */
}
jquery
setHeadingLineWidth('h1');
setHeadingLineWidth('h2');
setHeadingLineWidth('h3');
function setHeadingLineWidth(selector){
var hWidth;
var lineWidth;
var wrWidth = $('.heading-wrapper').width();
hWidth = $(selector,'.heading-wrapper').width();
lineWidth = wrWidth - hWidth;
$(selector).siblings('img').width(lineWidth);
}
heading width = width of the heading text inside the wrapper
line image width = wrapper width - heading text width
Hope that helps :)