Beginner, div/css problems [closed] - html

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I have amended my code with the help from below but now
the images and text seem 'all over the place'. Some
behind the div background some infont, and the same
with the text as well as some text on the left,
some on the right.
I've taken screen shot to show, and
added requested html output below.
How it should look. http://i.stack.imgur.com/8O9uM.png
How it currently looks. http://i.stack.imgur.com/4GUfi.png
------------------------------
html output as requested
<div class="ind">2 Bedroom property in LL11</p><div class="bottom"><div class="des"><p>Situated close to Wrexham town centre, this two bedroom mid terrace has gas central heating and double glazing and provi.....</p><ul id="info"><li><img src='127.0.0.1/vebra/assets/icons/money_icon.png'><span>£105000</span></li><li><img src='127.0.0.1/vebra/assets/icons/bed_icon.png'><span>2 Bedrooms</span></li><li><img src='127.0.0.1/vebra/assets/icons/area_icon.png'><span>LL11</span></li></ul><h3><br><br><a href='127.0.0.1/forsale/105322_24718166'>View Property Details</h3></div></div></div>
------------------------------
php code
echo '<div class="ind">';
echo "<a href='127.0.0.1/forsale/".$row['AGENT_REF']."' class='left'><img src='127.0.0.1/vebra/assets/".$row['MEDIA_IMAGE_02']."' width='296px'></a><br />"; // home image and link
echo '<h3>';
echo $row['TOWN'];
echo '</h3>';
echo '<p class="area">';
echo $row['PRICE'] . " Bedroom property in ". $row['POSTCODE1'];
echo '</p>';
echo '<div class="bottom">';
echo '<div class="des">';
echo '<p>' .htmlentities(substr($row['SUMMARY'],0,120)).".....".'</p>'; // shorten description
echo '<ul id="info">'; // price bed postcode
echo "<li><img src='127.0.0.1/vebra/assets/icons/money_icon.png'><span>"."£" . $row['PROP_SUB_ID']."</span></li>";
echo "<li><img src='127.0.0.1/vebra/assets/icons/bed_icon.png'><span>". $row['PRICE'] . " Bedrooms"."</span></li>";
echo "<li><img src='127.0.0.1/vebra/assets/icons/area_icon.png'><span>". $row['POSTCODE1']."</span></li>";
echo '</ul>';
echo '<h3>' . "<br>" . "<br>";
echo "<a href='127.0.0.1/forsale/".$row['AGENT_REF']."'>View Property Details</a>";
echo '</h3>';
echo '</div>';
echo '</div>';
echo '</div>';
------------------------------
css code
/* Sales Results nb overflow:scroll; */
li img { width: 20px; }
.left {
float: left;
margin-right: 10px;
}
#sale_results { }
#sale_results .sale_content { background-color: #fff; padding: 20px; -webkit-border-radius: 10px; -khtml-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; position: relative; }
#sale_results .sale_content h2.pagetitle { font-size: 38px; line-height: 41px; margin: 0 0 3px 0; color: #C4DA4B; font-weight: bold; }
#sale_results .sale_content p.subtitle { font-size: 20px; line-height: 22px; margin: 0 0 20px 0; color: #9B9EA0; }
#sale_results .sale_content .ind { height: 221px; position: relative; border: 1px solid #dedede; width: 922px; margin: 0 20px 20px 0; background: #fff url(images/sub_page_bg.png) repeat-x bottom; }
#sale_results .sale_content .ind > img {width: 295px;}
#sale_results .sale_content .ind.last { margin: 0 0 20px 0; }
#sale_results .sale_content .ind .bottom { float:right; clear: left; padding: 19px 15px 15px; width: 588px; height:188px;}
#sale_results .sale_content .ind h3 { font-size: 20px; line-height: 22px; color: #575B5C; margin: 0 0 7px 0; font-weight: bold; }
#sale_results .sale_content .ind h3 a { color: #575B5C; }
#sale_results .sale_content .ind h3 a:hover { color: #333; }
#sale_results .sale_content .ind p.area { font-size: 14px; color: #9B9EA0; line-height: 16px; margin: 0 0 15px 0; }
#sale_results .sale_content .ind des { font-size: 12px; color: #9B9EA0; line-height: 16px; margin: 0 0 15px 0; }
#sale_results .sale_content ul#info { padding: 0; margin: 0; float: left; position: absolute; bottom: 61px;}
#sale_results .sale_content ul#info li { margin: 0 0 10px 0; float: left; width: 130px; padding:0; background: none; }
#sale_results .sale_content ul#info li img { float: left; width: 24px; height: 24px; margin: 0 10px 0 0; }
#sale_results .sale_content ul#info li span { font-size: 14px; font-weight: bold; color: #3B3E40; line-height: 24px; float: left; }
#sale_results .sale_content .ind a.view { background: url(images/view_more.png) no-repeat; position: absolute; bottom: 0; height: 39px; width: 265px; background-position: 0 0; font-size: 0px; line-height: 0px; text-indent: -9999px; border: none; cursor: pointer; float: left; margin: 15px 0; }
#sale_results .sale_content .ind a.view:hover { background: url(images/view_more.png) no-repeat; height: 39px; width: 265px; background-position: 0 -39px; }
-------------------
Previous Post Below
The PHP is getting the info fine from the database
but I cannot get the text to the right of
the image, it shows low diagonal right
below where it should be.
------------------
- pic text -
- left right -
------------------
- text
- showing
- here
Maybe someone with fresh eyes can see something i'm not

Try styling your image with float: left; and your text with float: right;

If you are talking about the image at the top, then a simple float: left; would do the trick.
So add a class to the image or its anchor, for example class="left":
echo "<a class="left" href='127.0.0.1/forsale/?sale=".$row['AGENT_REF']."'><img src='127.0.0.1/vebra/assets/".$row['MEDIA_IMAGE_02']."' width='296px'></a><br />"; // home image and link
And then float it in your css:
.left {
float: left;
}
Here a jsfiddle of what I imagine you are trying to accomplish.

try to remove float:left from this line:
#sale_results .sale_content ul#info li span { font-size: 14px; font-weight: bold; color: #3B3E40; line-height: 24px; float: left; }

Related

Responsive page is not working in table

Currently for this project i am using bootstrap and my personal css files. I have defined page wrapper class to differentiate between menu item and content.
The table is working fine in broad view. Working(desktop view)
But while in mobile view half of the content displayed in dark background
Mobile view(not working)
code:
Php code for the Page:
<?php
include "includes/header.php"
?>
<div id="wrapper">
<!-- Navigation Bar -->
<?php include "includes/navigation.php" ?>
<div id="page-wrapper">
<div class="container-fluid">
<?php
$query = "SELECT * FROM patent_details where sap_id='$sap'";
$result = mysqli_query( $conn, $query );?>
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header dash-head">
<center>Patent View</center> <!-- All data defined here-->
</h1>
<table class="table">
<thead>
<th>Patent ID</th>
<th>Author other than UPES</th>
<th>Department</th>
<th>File Application No</th>
<th>Filling Date</th>
<th>Country</th>
<th>Patent Status</th>
<th>Currency</th>
<th>Income Generated</th>
</thead>
<tbody>
<?php
if( mysqli_num_rows($result) > 0 ) {
while( $row = mysqli_fetch_assoc($result) ) {
$patent_id = $row['patent_id'];
$auther_other_than_UPES = $row['author_other_than_UPES'];
$department = $row['department'];
$file_application_no = $row['file_application_no'];
$filing_date = $row['filing_date'];
$country = $row['country'] ;
$patent_status = $row['patent_status'];
$currency = $row['currency'];
$income_generated = $row['faculty_income_generated_through_patents'];
echo "<tr>";
echo "<td>$patent_id</td>";
echo "<td>$auther_other_than_UPES</td>";
echo "<td>$department</td>";
echo "<td>$file_application_no</td>";
echo "<td>$filing_date</td>";
echo "<td>$country</td>";
echo "<td>$patent_status</td>";
echo "<td>$currency</td>";
echo "<td>$income_generated</td>";
echo "<td><a type='button' href='patent_edit.php?id=".$patent_id."' >Edit</a>;</td>";
echo "</tr>";
}
}
else {
echo "No data available";
}
?>
</tbody>
</table>
<?php include "includes/footer.php"
?>
CSS code for the page:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin-top: 100px;
background-color: #222;
}
#media(min-width:768px) {
body {
margin-top: 50px;
}
}
#wrapper {
padding-left: 0;
}
#page-wrapper {
width: 100%;
padding: 0;
background-color: #fff;
}
#media(min-width:768px) {
#wrapper {
padding-left: 225px;
}
#page-wrapper {
padding: 10px;
}
}
/* Top Navigation */
.top-nav {
padding: 0 15px;
}
.top-nav>li {
display: inline-block;
float: left;
}
.top-nav>li>a {
padding-top: 15px;
padding-bottom: 15px;
line-height: 20px;
color: #999;
}
.top-nav>li>a:hover,
.top-nav>li>a:focus,
.top-nav>.open>a,
.top-nav>.open>a:hover,
.top-nav>.open>a:focus {
color: #fff;
background-color: #000;
}
.top-nav>.open>.dropdown-menu {
float: left;
position: absolute;
margin-top: 0;
border: 1px solid rgba(0,0,0,.15);
border-top-left-radius: 0;
border-top-right-radius: 0;
background-color: #fff;
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
.top-nav>.open>.dropdown-menu>li>a {
white-space: normal;
}
/* Side Navigation */
#media(min-width:768px) {
.side-nav {
position: fixed;
top: 51px;
left: 225px;
width: 225px;
margin-left: -225px;
border: none;
border-radius: 0;
overflow-y: auto;
background-color: #222;
}
.side-nav>li>a {
width: 225px;
}
.side-nav li a:hover,
.side-nav li a:focus {
outline: none;
background-color: #000 !important;
}
}
.side-nav>li>ul {
padding: 0;
}
.side-nav>li>ul>li>a {
display: block;
padding: 10px 15px 10px 38px;
text-decoration: none;
color: #999;
}
.side-nav>li>ul>li>a:hover {
color: #fff;
}
.navbar-inverse .navbar-brand {
color: #ff4500;
font-size: 25px;
}
.dash-head{
font-size: 40px;
color: #ff4703;
}
p{
font-size: 15px;
padding: 0;
}
.dash-list{
list-style: none;
}
footer {
position: fixed;
right: 0;
bottom: 0;
left: 0;
padding:0;
color: #fff;
background-color: #555;
text-align: center;
}
As you mentioned you are using bootstrap, in order to make your table responsive you should just make use of the classes available within the framework. I.e:
<table class='table table-responsive'>
//Rest of table here
</table>
You can find the complete documentation here: http://getbootstrap.com/css/#tables
Although you used bootstrap you haven't done anything to make the table responsive.
<div class="table-responsive">
<table class="table">
//Code
</table>
</div>
Use above mentioned code. I hope you will get what you wanted.

how to remove line breaks after each word in ionic

I made a custom list in my ionic app and it runs fine on my browser. But when I built it on android, the text in the h2 tag for the display name breaks to a new line after each word. I've tried removing the word-wrap and word-break from the css, but it still doesn't work.
This is the HTML for the view:
<ion-view view-title="Crave">
<fab ui-sref="post" class="ink"><i class="ion-compose"></i></fab>
<ion-content>
<ion-refresher pulling-text="Pull to refresh" pulling-icon="ion-arrow-down-b" on-refresh="doRefresh()">
</ion-refresher>
<div class="m-cards">
<div class="m-card" ng-repeat="post in posts">
<div class="m-card-header">
<span><i class="ion-android-time"></i>&nbsp In 2hrs</span>
<img ng-src="{{post.face}}" class="ink rip">
<h2>{{post.name}}</h2><br />
<p>#{{post.username}}</p><br /><br />
</div>
<span>{{post.postText}}</span>
<div class="m-card-stats">
<i class="ion-ios-heart"></i>&nbsp {{post.likes}}
<i class="ion-chatbox"></i>&nbsp {{post.comments}}
<i class="ion-android-share-alt"></i>
<span>12d ago</span>
</div>
<hr />
</div>
</div>
</ion-content>
</ion-view>
And this is the css:
.m-cards {
}
.m-card {
border-radius: 2px;
margin-bottom: 5px;
padding: 2px 20px;
width: 100%;
}
.m-card a {
color: #ef473a;
}
.m-card-post-alt {
color: #777;
height: 18px;
overflow: hidden;
}
.m-card-header h2 {
color: #000;
float: left;
font-size: 12pt;
font-weight: 300;
margin: 0;
margin-left: 10px;
word-wrap: normal !important;
word-break: normal !important;
}
.m-card-header p {
color: #000;
float: left;
margin: 0;
margin-left: 10px;
}
.m-card-header span {
color: #444;
float: right;
margin: 0;
}
.m-card-header img {
border-radius: 5px;
float: left;
height: 48px;
width: 48px;
}
.m-card-header span {
color: #444;
float: right;
margin: 0;
}
.m-card-stats {
margin-top: 20px;
}
.m-card-stats span {
color: #000;
float: right;
margin: 0;
}
.m-card-stats a {
color: #000;
margin-right: 20px;
}
Thanks in advance!!!
Finally fixed it. All I needed was to set the word-spacing to normal.
.m-card-header h2 {
color: #000;
float: left;
font-size: 12pt;
font-weight: 300;
margin: 0;
margin-left: 10px;
word-spacing: normal !important;
}

HTML Div Disappears when given Fixed Position

Currently I am developing a Facebook like Messenger. Right now I am working under a chat-area, this thing should be fixed. But if I give position:fixed suddenly div disappear. I don't know what to do.
Here is my HTML/PHP code.
<?php
// Turn off all error reporting
//shop not login users from entering
if(isset($_SESSION['id'])){
$user_id = $_SESSION['id'];
}else{
}
require_once("./inc/connect.inc.php");
?>
<header>
<link rel="stylesheet" href="home - Copy.css" />
<nav>
<h3><a class="h3" href="#">Cp</a></h3>
<div>
<?php
//Start your session
session_start();
//Read your session (if it is set)
if (isset($_SESSION['user_login']))
echo $_SESSION['user_login'];
?>
</div>
<div><span>Logout</span></div>
<div><span>Settings </span></div>
</nav>
<body>
<div class="shead">
<div class="a1"> <li >Frequent Member</li>
<ul>
<?php
//show all the users expect me
$user_id = $_SESSION['id'];
$q = mysql_query("SELECT * FROM `users` WHERE id!='$user_id'");
//display all the results
while($row = mysql_fetch_assoc($q)){
echo "<a href='home.php?id={$row['id']}'><p>{$row['username']}</p></a>";
}
?>
</ul>
</div>
<div class="a2"> <li >Site's Popular in Your College</li></div>
</div>
</header>
<div class="rss">
<?php
//include('rssclass.php');
//sinclude('rss.php');
?>
<div class="message-right">
<!-- display message -->
<div class="display-message">
<?php
//check $_GET['id'] is set
if(isset($_GET['id'])){
$user_two = trim(mysql_real_escape_string( $_GET['id']));
//check $user_two is valid
$q = mysql_query( "SELECT `id` FROM `users` WHERE id='$user_two' AND id!='$user_id'");
//valid $user_two
if(mysql_num_rows($q) == 1){
//check $user_id and $user_two has conversation or not if no start one
$conver = mysql_query( "SELECT * FROM conversation WHERE (user_one='$user_id' AND user_two='$user_two') OR (user_one='$user_two' AND user_two='$user_id')");
//they have a conversation
if(mysql_num_rows($conver) == 1){
//fetch the converstaion id
$fetch = mysql_fetch_assoc($conver);
$conversation_id = $fetch['id'];
}else{ //they do not have a conversation
//start a new converstaion and fetch its id
$q = mysql_query( "INSERT INTO `conversation` VALUES ('','$user_id',$user_two)");
$conversation_id = mysql_insert_id($con);
}
}else{
die("Invalid $_GET ID.");
}
}else {
die("Click On the Person to start Chating.");
}
?>
</div>
<div class="send-message">
<!-- store conversation_id, user_from, user_to so that we can send send this values to post_message_ajax.php -->
<input type="hidden" id="conversation_id" value="<?php echo base64_encode($conversation_id); ?>">
<input type="hidden" id="user_form" value="<?php echo base64_encode($user_id); ?>">
<input type="hidden" id="user_to" value="<?php echo base64_encode($user_two); ?>">
<div class="textbox">
<input class="t_box" type="text" id="message" placeholder="Enter Your Message"/>
<button class="t_btn" id="reply">Reply</button>
<span id="error"></span>
</div>
</div>
</div>
<!--
<div class="textbox">
<form action="#" method="post">
<input type="text" name="msg_body" class="t_box" id="t_box" >
<input type="submit" class="t_btn" id="t_btn" name="submit" value="Send">
</form>
</div>-->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</body>
Here is my css and .message-right is the element where problem occurs.
#import url(http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic);
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Roboto', Arial, sans-serif;
background-color: #222;
overflow-x: hidden;
text-align: center;
}
header {
position: fixed;
width: 100%;
height: 50px;
background-color: #FFD700;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}
header > nav > div {
float: right;
width: 10.6666%;
height: 100%;
position: relative;
}
header > nav > div > a {
text-align: center;
width: 100%;
height: 100%;
display: block;
line-height: 50px;
color: #222;
transition: background-color 0.2s ease;
text-transform: uppercase;
}
header > nav > div:hover > a {
background-color: rgba(0, 0, 0, 0.1);
cursor: pointer;
}
a{
text-decoration: none;
color: #000;
}
a:hover{
text-decoration: none;
background-color: #FFD700;
font-weight: bolder;
}
h3{
float: left;
height: 100%;
text-align: bottom;
padding-top: 10px;
padding-left: 10px;
}
.h3{
color: #222;
font-size:25px;
}
.nav{
position: fixed;
}
.title-head {
font-size:18px;
font-weight:bold;
text-align:left;
background-color:#F5F6F7;
color:#000;
float: left;
width: 455.33px;
}
.feeds-links {
text-align:left;
width: 455.33;
font-size: 20px;
padding:5px;
border:1px solid #dedede;
padding-top:inherit;
color: #000;
background-color: #FFFFFF;
}
.rss{
float: right;
padding-top: 100px;
}
.h2{
color: #000;
background: #ffd700;
height: 45px;
width: 455.33px;
padding-top: 10px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}
.textarea{
float: left;
padding-top:553px;
width: 455.3px;
position: fixed;
}
.t_box{
float: left;
border-radius: 5px;
border: 1px solid #FFD700;
background-color: #fff;
padding: 5px 5px;
font-size: 1em;
width: 78%;
outline: none;
}
.textbox{
background-color: #FFD700;
border: 1px solid #FFD700;
margin-top: 565px;
padding: 10px;
height: 50px;
width:455.5px;
float: left;
}
.t_btn{
text-decoration: none;
color:#222;
font-weight: bold;
background-color: transparent;
border: none;
font-size: 1em;
cursor: pointer;
height: 33px;
width: 70px;
outline: none;
}
.shead{
height: 50px;
width: 910px;
float: right;
margin-top: 0px;
background: #FFD700;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
position: sticky;
border-top: #000;
}
.a1{
text-align: center;
width: 50%;
display: block;
line-height: 50px;
color: #000;
font-size: 19px;
list-style: none;
font: #000;
}
.a2{
text-align: center;
width: 50%;
display: block;
line-height: 50px;
color: #222;
float: right;
transition: background-color 0.2s ease;
font-size:19px;
text-decoration: none;
margin-top: -150px;
list-style: none;
}
.frequentmem{
display: block;
height: 100%;
width: 100%;
float: right;
}
.message-right{
margin-right:908px;
background: #fff;
height: 615px;
width:455.5px;
margin-top: 50px;
float: left;
position: fixed;
}
hr{
background: #e9e9e9;
border: 0;
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 1px;
margin: 0;
min-height: 1px;
}
.message{
width: 455.3px;
background: #fff;
height: 50px;
padding: 8px 24px;
}
float:left doesn't do anything if your position is fixed, you should add left:0 instead, on the other hand, you should always specify vertical and horizontal position of a fixed element unless you want it to stay on the part of the page it was rendered this means if your message-right are is rendered below the fold it will not be visible to your users unless you tell it at what coordinates it should remain fixed
I think floating divs and fixing the position do not go well together.
Try removing the float:left and as the user above suggested, adding the left: some_pixels, top: some_pixels to align the div "absolutely" on the page. I usually add a border/background color to divs to identify where they are on the page (then remove later), so you can try that to to make sure it is where you expect it to be.
.message-right{
margin-right:908px;
background: #fff;
height: 615px;
width:455.5px;
margin-top: 50px;
**float: left;** <-- remove
position: fixed;
left: 50px;
top: 50px;
}
With a fixed position, maybe your div is behind some other content. Have you tried using a z-index ? Setting the z-index to 1 would move it forward over another div. Also, you have no top, bottom, right or left dimensions for your fixed position. You could try moving the div around by assigning those values. Example.
Anyways, it is hard to tell what your problem is without the HTML to go with the CSS. Posting that would help you get better response.
I don't have 50 reputation, so I had to add this comment as an answer.
your code looks fine. Adding a border should do the trick.For instance:
But without the rest of the code(html and css) it would be hard to know what is wrong.
.chat-area{
margin-right:908px;
background: #fff;
border:1px solid black;<-- like this
height: 615px;
width:455.5px;
margin-top: 50px;
float: left;
position: fixed;
}

I can't get rid of the black background behind my nav links

I can't resolve this issue. I don't know how to get rid of the black behind the navs. It seems to me all the css styling is not black when I review each element.
Cheers.
Here is a screenshot of my problems.
https://drive.google.com/file/d/0B7T0xtNhpIRZYjc5VHlNVlVTdTg/view?usp=sharing
Here is the PHP/HTML
<head>
<link type="text/css" rel="stylesheet" href="Car_Style.css"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" id="font-awesome-css" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" type="text/css" media="screen">
</head>
<body>
<header id="header" class="loading";]>
<!-- Logo -->
<div id="logo">
</div>
<!-- Nav -->
<nav id="nav">
<img src="http://1673-itstudies/12-infotech/jsummers/About%20Us//About%20US/Images/LOGO_copy.png" id="logo">
<ul id="links4nav">
<li>New Vehicle</li>
<li>News</li>
<li>Contact</li>
<li>About</li>
</ul>
<a href="http://1673-itstudies/12-infotech/jsummers/Carsales_Network.php">
<h4 id="navtitle">AUTO NETWORK | THE LEAD SALE</h4>
</a>
</nav>
</header>
<div id=scroller>
<a href="#" class="back-to-top" style="display: inline;">
<i class="fa fa-arrow-circle-up"></i>
</a>
<script id="scroller">
jQuery(document).ready(function() {
var offset = 250;
var duration = 300;
jQuery(window).scroll(function() {
if (jQuery(this).scrollTop() > offset) {
jQuery('.back-to-top').fadeIn(duration);
} else {
jQuery('.back-to-top').fadeOut(duration);
}
});
jQuery('.back-to-top').click(function(event) {
event.preventDefault();
jQuery('html, body').animate({scrollTop: 0}, duration);
return false;
})
});
</script>
<script id ="fading-scroller">
$(window).scroll(function() {
var pxFromBottom = 350;
if ($(window).scrollTop() + $(window).height() > $(document).height() - pxFromBottom) {
$('.scroll-btn').fadeOut('slow');
} else {
$('.scroll-btn').fadeIn('slow')
}
});
</script>
</div>
</body>
<?php
try {
# Connect to SQLite database
$dbh = new PDO("sqlite:Car_Sales_Network");
# Prepare SQL statement
$sth = $dbh->prepare('SELECT * FROM Cars_On_Network' );
# Set the Fetch Mode to Associative Array
$sth->setFetchMode(PDO::FETCH_ASSOC);
# Run the query on the database
$sth->execute();
//table printout
echo "<table>";
# Loop through returned records
while($row = $sth->fetch()) {
//print_r($row);spot
//print_r($row);
# If the image field is empty, change to dummy image
if (empty($row['car_image_url'])) {
$row['car_image_url'] = 'http://1673-itstudies/12-infotech/jsummers/Cars_Photos/placeholder.png';
}
// added these line */
echo "<table>";
/* added this line */
/* // added this line */
echo "<th>Car Make:</th>";
echo "<th>Car Model:</th>";
echo "<th>Car Badge:</th>";
echo "<th>Car Price:</th>";
echo "<th>Car Transmission:</th>";
echo "<th>P Plate Legality:</th>";
echo "<th id='car'>Car Image:</th>";
echo "<div id='1'>";
echo "<tr>";
echo "<td>". $row["car_make"] . "</td>";
echo "<td>". $row["car_model"] . "</td>";
echo "<td>". $row["car_badge"] . "</td>";
echo "<td>". $row["price"] . "</td>";
echo "<td>". $row["trans"] . "</td>";
echo "<td>". $row["P_Plate_Legal"] . "</td>";
echo "<td id='img'><img src=\"". $row["car_image_url"] . "\" /></td>";
/* // this allows the image link to be converted from a link to an image */
echo "</tr>";
echo "</div>";
//echo $row["Game_ID"];
echo "<br>";
}
echo "</table>";
}
catch(PDOException $e) {
echo $e->getMessage();
}
?>
Here is the CSS:
* {
font-family: Arial;
color: white;
transition: 1s;
background-image: url(http://1673-itstudies/12-infotech/jsummers/Cars_Photos/background.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
-webkit-text-stroke: 0.1px #333333;
}
#links4nav {
list-style-type: none;
margin: 0;
padding: 0;
font-family: Arial;
background-color: rgba(255, 255, 255, 0.9); /* Color white with alpha 0.9*/
background-color: orange;
transition: 1s;
}
#navi {
background: #ff0015;
background-color: #ff0015;
font-family: Arial;
display: inline-block;
}
table {
padding: 20px;
border: 2px;
outline: none;
background-image: none;
color: white;
}
th td {
padding-right: 20px;
padding-left: 20px;
margin-right: 5em;
}
/*********************************************************************************/
/* Header */
/*********************************************************************************/
#header {
position: fixed;
z-index: 10000;
left: 0;
top: 0;
width: 100%;
background: #ff0015;
height: 3em;
line-height: 3em;
transition: none;
padding-top: 8px;
}
body {
padding-top: 3em;
}
#logo {
position: absolute;
left: 1em;
top: 2px;
height: 3em;
line-height: 3em;
letter-spacing: -1px;
}
#logo a {
font-size: 1.25em;
}
#nav {
position: fixed;
right: 0.5em;
top: 0;
height: 3em;
line-height: 3em;
color: #ff0015;
opacity: 30;
}
#nav ul {
margin: 0;
}
#nav ul li {
display: inline-block;
margin-left: 0.5em;
font-size: 0.9em;
}
#nav ul li a {
display: block;
color: #ff0015;
text-decoration: none;
height: 3em;
line-height: 3em;
padding: 0 0.5em 0 0.5em;
outline: 0;
background-color: #ff0015;
}
/*
td{
width: 336px;
height: 223px;
}
*/
#img {
opacity: 100;
border: solid black 2px;
}
#logo {
width: 212px;
height: 48px;
position: fixed;
float: left;
}
#navtitle {
font-family: Arial;
color: white;
position: fixed;
left: 230px;
background: #ff0015;
top: -22px;
}
ul #nav #navbar{
color: #ff0015;
background-color: #ff0015;
}
#car{
width: 50px;
height: 50px;
}
}
.back-to-top {
background: none;
margin: 0;
position: fixed;
bottom: 0;
right: 1000;
width: 70px;
height: 70px;
z-index: 100;
display: none;
text-decoration: none;
color: #ffffff;
transition: 0.5s;
}
.back-to-top i {
font-size: 60px;
position: fixed;
transition: 0.5s;
}
#scroller {
background: none;
transition: 0.5s;
}
you may wanna try this:
#nav ul li {
display: inline-block;
margin-left: 0.5em;
font-size: 0.9em;
background:inherit; //Inherits its property from its parent element which in your case can be the solution
}
Try this
#nav ul li, #nav ul { background:none;}
I got your code to a fiddle but there I cant see the issue, so lets try with above.
try this
#nav ul li {
display: inline-block;
margin-left: 0.5em;
font-size: 0.9em;
background:none; //added new line.
}
Update 1:
#links4nav {
list-style-type: none;
margin: 0;
padding: 0;
font-family: Arial;
transition: 1s;
}
#nav ul li a {
display: block;
color: #fffff;
text-decoration: none;
height: 3em;
line-height: 3em;
padding: 0 0.5em 0 0.5em;
outline: 0;
}
You got lots of repeated css. avoid those. Avoid unnecessary id insertions. Map the style.css to your css for changes.
Plunker Output

Text not going underneath other portion of text

My text does not seem to want to go underneath this portion of text!
http://prntscr.com/1x2zju
No matter how hard we try to get it to go under it, it doesn't go below it.
.avatar {
float: left;
width: 35px;
height: 35px;
border: 1px solid #000;
}
.name {
color: #3B63DB;
font-size: 15px;
margin-top: 0;
float: left;
padding-left: 5px;
}
.text {
font-size: 12px;
color: #000;
font-family: Helvetica, 'SEGOEUIL', sans-serif;
margin-left: 3px;
float: auto;
}
HTML:
<div id='post'>
<img class='avatar' src='http://cppsgang.com/images/person.png'>
<p class='name'>Thomas A.</p>
<p class='text'>Hello there! This is my status update. Unfortunately, it will not go below my name. Is there any way I can put it below my name, or is it stuck like this forever? I have to add more in, blah blah blah, to show you how it eventually breaks apart - just not underneath the name. Thanks for all the help you can give!</p>
<a href='system/posts/delete.php?id=$row[0]'/><span style='color: red;'>Delete</span></a>
</div>
Thanks!
http://jsfiddle.net/QUFx5/
EDIT WITH WORKING
JSFIDDLE
HTML
<div id='post'>
<img class='avatar' src='http://lorempixel.com/output/people-q-c-35-35-9.jpg'>
<p class='name'>Thomas A.</p>
<p class='text'>Hello there! This is my status update. Unfortunately, it will not go below my name. Is there any way I can put it below my name, or is it stuck like this forever? I have to add more in, blah blah blah, to show you how it eventually breaks apart - just not underneath the name. Thanks for all the help you can give!</p>
<a href='system/posts/delete.php?id=$row[0]'/><span style='color: red;'>Delete</span></a>
</div>
CSS
.avatar {
float: left;
width: 35px;
height: 35px;
border: 1px solid #000;
}
.name {
color: #3B63DB;
font-size: 15px;
margin: 0;
padding-left: 45px;
}
.text {
font-size: 12px;
color: #000;
font-family: Helvetica, 'SEGOEUIL', sans-serif;
margin-left: 5px;
padding-left:45px;
margin:0;
}
I have tried with your jsfiddle.net.
This thing worked for me:
.avatar {
float: left;
width: 50px;
height: 50px;
border: 1px solid #000;
}
.name {
color: #3B63DB;
font-size: 15px;
margin-top: 0;
padding-left: 5px;
}
.text {
font-size: 12px;
color: #000;
font-family: Helvetica, 'SEGOEUIL', sans-serif;
margin-left: 3px;
}
I have removed float from name and text class. Also, increased the width & height of avatar to 50px each.
The new code I tried which works according to your requirement:
.avatar {
float: left;
width: 35px;
height: 35px;
border: 1px solid #000;
}
.name {
color: #3B63DB;
font-size: 15px;
}
.text {
font-size: 12px;
color: #000;
font-family: Helvetica, 'SEGOEUIL', sans-serif;
margin-top:-15px;
}