I'm trying to make a list with people that have been stored in a mysql database, however only the first database item is styled properly and the others are out of place. I'm fairly new with css and I probably made a mistake in the while loop or positioning.
https://i.imgur.com/cKJqT6s.png
Image ^^
The code that I'm using is as followed:
<div id="adminsummary">
<div id="admintitel">
<p id="admintext">Admin Overview</p>
</div>
<?php
while ($row = mysqli_fetch_array($result)) {
$steamid = $row["steamid"];
$xml = simplexml_load_file("http://steamcommunity.com/profiles/$steamid/?xml=1");
if (!empty($xml)) {
$username = $xml->steamID;
}
?>
<div id="admin">
<img id="adminimg" src="<?php echo $steamprofile['avatarmedium']; ?>">
<p id="adminname"><?php echo $username; ?></p>
<!-- <p id="adminname"> SteamID: <?php echo $row["steamid"]; ?></p> -->
<p id="adminname"> Rank: <?php if ($row["rank"] == 1) {echo "SuperAdmin";} else {echo "Admin";} ?></p>
<hr id="hr2">
</div>
</div>
The stylesheet:
#adminsummary {
background: white;
margin-top: 5%;
height: 75%;
width: 25%;
margin-right: 5%;
float:right;
border-radius: 25px;
box-shadow: 10px 10px 77px -6px rgba(0,0,0,0.59);
}
#admintitel{
background: #343a40;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
#admintext{
color: white;
font-family: sans-serif;
font-weight: bold;
text-align: center;
padding: 25px;
}
#adminimg {
border-radius: 25px;
float: left;
margin-left: 25px;
}
#hr2 {
display: block;
margin-top: 25px;
margin-bottom: 0.5em;
margin-left: auto;
margin-right: auto;
border-style: inset;
border-width: 1px;
}
#adminname {
text-align: left;
font-weight: bold;
margin-left: 25%;
font-family: sans-serif;
}
Thanks for taking the time to help me
Try putting classes instead of id in your divs and p inside the while loop.
IDs are unique in CSS, that explain why the first row is styled, not the others.
If you modify the HTML and remove the IDs within the loop you can use a combination of classes with child/sibling selectors to assign styles in a cleaner way
<!-- these IDs are OK as they are unique ( presumably ) -->
<div id="adminsummary">
<div id="admintitel">
<p id="admintext">Admin Overview</p>
</div>
<?php
while ($row = mysqli_fetch_array($result)) {
$steamid = $row["steamid"];
$xml = simplexml_load_file("http://steamcommunity.com/profiles/$steamid/?xml=1");
if (!empty($xml)) {
$username = $xml->steamID;
}
?>
<!-- use classes &/or sibling selectors for cleaner html ~ no duplicate IDs though -->
<div class="admin">
<img src="<?php echo $steamprofile['avatarmedium']; ?>">
<p><?php echo $username; ?></p>
<p> Rank: <?php if ($row["rank"] == 1) {echo "SuperAdmin";} else {echo "Admin";} ?></p>
<hr />
</div>
<?php
}//close loop
?>
</div>
the slightly modified CSS using child selectors to assign styles within the .admin code block
#adminsummary {
background: white;
margin-top: 5%;
height: 75%;
width: 25%;
margin-right: 5%;
float:right;
border-radius: 25px;
box-shadow: 10px 10px 77px -6px rgba(0,0,0,0.59);
}
#admintitel{
background: #343a40;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
#admintext{
color: white;
font-family: sans-serif;
font-weight: bold;
text-align: center;
padding: 25px;
}
#adminsummary .admin img {
border-radius: 25px;
float: left;
margin-left: 25px;
}
#adminsummary .admin hr {
display: block;
margin-top: 25px;
margin-bottom: 0.5em;
margin-left: auto;
margin-right: auto;
border-style: inset;
border-width: 1px;
}
#adminsummary .admin p {
text-align: left;
font-weight: bold;
margin-left: 25%;
font-family: sans-serif;
}
Related
I am currently trying to add padding to the heading of this container and for some reason it's not letting me add any padding to the left or right. The image below show what it looks like at the moment.
here is my code:
<?php
$feed = 'http://miletich2.blogspot.co.uk/feed/';
$rss = fetch_feed($feed);
?>
<div class="container">
<div class="clear">
<div class="right">
<div class="rss-container">
<div class="rss-heading">
<?php
$title = "Clashing With Life";
$description = 'This is a blog written by an autistic person for other autistic people about <br>some of the biggest issues in life, whether deplorable or marvelous.';
echo '<h3 class="text-center title">' . $title . '</h3>';
echo '<p class="text-center">' . $description . '</p>';
?>
</div>
<?php
if ( !is_wp_error($rss) ) :
$maxitems = $rss->get_item_quantity(3);
$rss_items = $rss->get_items(0, $maxitems);
if ($rss_items):
foreach ($rss_items as $item) :
$item_title = esc_attr( $item->get_title() );
$item_permalink = esc_url( $item->get_permalink() );
$item_post_date = $item->get_date( get_option('date_format') );
$item_excerpt = wp_trim_words( wp_strip_all_tags( $item->get_description(), true ), 50 );
echo sprintf('<div class="spacing">%s<div class="pull-right">%s</div><p>%s</p><hr></div>', $item_permalink, $item_title, $item_post_date, $item_excerpt);
endforeach;
endif;
endif;
?>
Here is my css:
.right{
float:right;
}
.rss-container{
max-width: 400px;
width: 100%;
margin: 25px auto;
background: #f4f4f4;
padding: 0 20px 0 20px;
}
.rss-heading {
background: #7ED321;
color: #000;
padding: 15px 30px;
border-radius: 6px 6px 0 0;
-webkit-border-radius: 6px 6px 0 0;
font-weight: bold;
}
.rss-heading p{
font-size:9px;
}
hr{
border-top: 1px solid #DCDCDC !important;
}
.article-head{
line-height: 2em;
font-family: Roboto Condensed;
font-weight: bold;
}
.clear{
clear:both;
}
.spacing a {
line-height: 2em;
font-size: 15px;
}
.pull-right{
line-height: 2em;
font-size: 15px;
}
h3.title {
font-family: Roboto Condensed !important;
font-weight: bold;
}
in .rss-container I added this: padding: 0 20px 0 20px;
and .rss-heading padding: 15px 30px; I tried to change 30px to another value since I just want it to change left and right and it continued to change top and bottom. Any help would be appreciated!
To change just the left and right padding values, you can't use the 'padding' shortcut. Explicitly specify:
padding-right: 30px;
padding-left: 30px;
That will leave top and bottom unchanged.
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 have searched everywhere for an answer, but I don't think I'm asking the question in the right way. I have two columns, but I need the elements to stack and cant seem to make anything work. I also want to add a background color to make the elements stand out.
<style type="text/css">
#showcase {
width: 100%;
margin-bottom: 20px;
margin-top: 4px;
vertical-align:top;
}
#showcase > div {
width: 280px;
float: left;
border: 1px solid #ddd;
padding: 5px;
vertical-align:top;
margin-left: 0px;
}
#showcase > div:first-child {
margin-left: 0;
vertical-align:top;
}
#showcase > div > div {
float: right;
margin-left: 8px;
vertical-align:top;
font: 12px arial, sans-serif;
}
#showcase > div > img:last-child {
width: 150px;
clear: both;
margin-top:16px;
margin-left:0px;
vertical-align:top;
}
img.floatLeft {
float: left;
margin: 4px;
}
img.floatRight {
float: right;
margin: 4px;
}
</style>
<div class="module" style="margin-top:0px;">
<div class="module-header"><h3>Product Spotlight</h3></div>
</div>
<div id="showcase">
<? while($row = mysql_fetch_array($products_showcase_query)): ?>
<div>
<span style="display: block;font-size:20px;line-height: 130%;margin-bottom:4px;"><?= $row['product_headline'] ?></span>
<img src="../product_images/<?= $row['product_image'] ?>" style="width: 134px; float: left;" />
<div><div class="floatLeft">
<?= $row['product_summary'] ?>
</div></div>
<img src="../product_logos/<?= $row['product_logo'] ?>" />
</div>
<? endwhile ?>
<span style="display: block;clear:both;"></span>
</div>
layout example
Any help would be appreciated! Thank you :)
I would like to change the size of this facebook style comment box. I don't have any experience or knowledge of CSS and I couldn't figure out which CSS block to modify. Thanks in advance. I have included the CSS file and the file that utilizes the CSS specs. Thanks again.
.emAddComment{
background-color: #ECEFF5;
border-bottom: 1px solid #E5EAF1;
clear: left;
float: none;
margin-bottom: 2px;
overflow: hidden;
padding: 5px 15px 4px 5px;
display: block;
font-size: 11px;
color: #333;
font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
text-align: left;
}
input.emButton{
padding: 2px 4px 3px;
color: #FFF;
background-color: transparent;
border: medium none;
cursor: pointer;
display: block;
font-weight: bold;
font-size: 11px;
margin: 0;
overflow: visible;
width: auto;
}
span.emButton{
background-color: #5B74A8;
border-color: #29447E #29447E #1A356E;
border-width: 1px;
border-style: solid;
display: inline-block;
outline: medium none;
vertical-align: bottom;
}
.emAddComment textarea{
width: 50%;
height: 29px;
overflow: hidden;
margin: 0 10px 5px 0;
min-height: 29px;
border: 1px solid #BDC7D8;
font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
font-size: 11px;
padding: 3px;
}
.emAddComment .addEmMail, .emAddComment .addEmName{
margin: 0 10px 5px 0;
border: 1px solid #BDC7D8;
font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
font-size: 11px;
padding: 3px;
width: 200px;
}
.emAddComment label{
width: 75px;
text-align: right;
}
.emComment{
background-color: #ECEFF5;
border-bottom: 1px solid #E5EAF1;
clear: left;
float: none;
margin-bottom: 2px;
overflow: hidden;
padding: 5px 0 4px 5px;
display: block;
color: #333;
}
.emInfoMessage{
background-color: #FFEFF5;
border-bottom: 1px solid #E5EAF1;
clear: left;
float: none;
margin-bottom: 2px;
overflow: hidden;
padding: 5px 0 4px 5px;
display: block;
color: #333;
text-align: center;
font-weight: bold;
}
.emComment .emCommentImage{
float: left;
}
.emComment .emCommentText{
padding-right: 7px;
margin-left: 40px;
}
.emComment .emCommentInto{
color: #777;
padding: 7px 7px 1px;
text-align: right;
}
.emShowAllComments, .emHideAllComments{
border-bottom: 1px solid #E5EAF1;
clear: left;
float: none;
margin-bottom: 2px;
overflow: hidden;
padding: 5px 0 4px 5px;
display: block;
color: #333;
background: #ECEFF5 url('images/comments.png') no-repeat 5px 4px;
padding-left: 26px;
}
#emContent, .emContent{
font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
font-size: 11px;
}
#emContent a, .emContent a{
text-decoration: none;
color: #3B5998;
}
#emContent a:hover, .emContent a:hover{
text-decoration: underline;
}
.emSenderName{
font-weight: bold;
}
.emAddComment .addEmPot{
display: none;
}
.emCommentLike{
margin-top: 5px;
color: #777;
}
<?php
require_once('commentanything/config.inc.php');
require_once('commentanything/funcs.inc.php');
## check if there is a moderation action ###
#
$actionType = null;
$actionComleted = false;
if($_GET['emAct'] and $_GET['emCommentKey'] and $_GET['emCommentID'] and $_GET['emCommentOID']){
//check if the comment exists and I have access
if($comment = $db->query("SELECT * FROM em_comments WHERE id = ".(int)$_GET['emCommentID']." AND object_id = ".(int)$_GET['emCommentOID']." AND access_key = ".$db->quote($_GET['emCommentKey']))->fetch()){
switch($_GET['emAct']){
case 'delete': {
$actionCompleted = true;
$actionType = 'delete';
$db->query("DELETE FROM em_comments WHERE id = ".(int)$_GET['emCommentID']." AND object_id = ".(int)$_GET['emCommentOID']." AND access_key = ".$db->quote($_GET['emCommentKey']));
break;
}
case 'allow': {
$actionCompleted = true;
$actionType = 'allow';
$db->query("UPDATE em_comments SET visible = '1' WHERE id = ".(int)$_GET['emCommentID']." AND object_id = ".(int)$_GET['emCommentOID']." AND access_key = ".$db->quote($_GET['emCommentKey']));
break;
}
}
}
}
#
## end check ###############################
//get comments from database
$myip = ip2long($_SERVER['REMOTE_ADDR']);
$comments = $db->query("SELECT DISTINCT
em_comments.*,
em_likes.vote
FROM em_comments
LEFT JOIN em_likes ON em_comments.id = em_likes.comment_id AND em_likes.sender_ip = ".$myip."
WHERE
object_id = ".$db->quote($object_id)." AND
visible = '1'
ORDER BY id")->fetchAll();
// -- form output ------------------------------------------------
$total = count($comments);
$counter = 1;
$html = '<div id="emContent_'.$object_id.'" class="emContent">';
if($actionCompleted){
$html .= '<div class="emInfoMessage">';
$html .= $lang['cid'].' '.(int)$_GET['emCommentID'].' '.$lang['wassuc'].' '.($actionType=='delete'?$lang['deleted']:$lang['moderated']).'!';
$html .= '</div>';
}
if($total > $CCOUNT){
$html .= '<div class="emShowAllComments" id="emShowAllComments_'.$object_id.'">
'.$lang['view'].' <span id="total_em_comments_'.$object_id.'">'.$total.'</span> '.$lang['view2'].' <noscript><em>This page needs JavaScript to display all comments</em></noscript>
</div>
<div class="emHideAllComments" id="emHideAllComments_'.$object_id.'" style="display: none;">
'.$lang['hide'].' <span id="total_em_comments_to_hide_'.$object_id.'">'.$total.'</span> '.$lang['view2'].'
</div>';
}
foreach($comments as $comment){
if($comment['sender_name']){
if($comment['sender_mail']){
$comment['sender_name'] = jsEncode($comment['sender_mail'], $comment['sender_name']);
}
$sender = '<span class="emSenderName">'.$comment['sender_name'].'</span>: ';
}else{
$sender = '';
}
if($comment['vote']){
$likeText = commentLikeText($comment['rating_cache']-1);
}else{
$likeText = ''.$lang['ilike'].'';
if($comment['rating_cache']){
$likeText .= ' — '.commentLikeText($comment['rating_cache'],false);
}
}
$html .= '<div class="emComment emComment_'.$object_id.' '.($counter < ($total - ($CCOUNT - 1))?'emHiddenComment emHiddenComment_'.$object_id:'').'" id="comment_'.$comment['id'].'" '.($counter < ($total - ($CCOUNT - 1))?'style="display:none"':'').'>
<div class="emCommentImage">
<img src="http://www.gravatar.com/avatar/'.gravatar($comment['sender_mail'], false).'" width="32" height="32" alt="Gravatar" />
</div>
<div class="emCommentText">
'.$sender.stripslashes($comment['comment_text']).'
</div>
<div class="emCommentInto">
'.strftime($DATEFORMAT,strtotime($comment['created'])).'
<div class="emCommentLike" style="'.($ALLOWLIKE?'':'display:none;').'">
<span id="iLikeThis_'.$comment['id'].'">
<em>'.$likeText.'</em>
</span>
</div>
</div>
</div>';
$counter++;
}
$html .= '</div>';
$html .= '<div id="emAddComment_'.$object_id.'" class="emAddComment">
<form method="post" action="commentanything/php/addComment.php" onsubmit="return false;">
<span '.($SHOWNAME?'':'style="display: none;"').' id="emNameSpan_'.$object_id.'" class="emNameSpan">
<label for="addEmName_'.$object_id.'">'.$lang['name'].':</label>
<input type="text" placeholder="'.$lang['enterName'].'" id="addEmName_'.$object_id.'" class="addEmName" name="sender_name" />
</span>
<span '.($SHOWMAIL?'':'style="display: none;"').' id="emMailSpan_'.$object_id.'">
<label for="addEmMail_'.$object_id.'">'.$lang['mail'].':</label>
<input type="text" placeholder="'.$lang['enterMail'].'" id="addEmMail_'.$object_id.'" class="addEmMail" name="sender_mail" />
</span>
<textarea placeholder="'.$lang['enterComment'].'" id="addEmComment_'.$object_id.'" class="addEmComment" name="comment"></textarea>
<input type="text" name="email" value="" id="addEmPot_'.$object_id.'" class="addEmPot" />
<input type="hidden" name="object_id" value="'.$object_id.'" />
<span class="emButton">
<input type="submit" class="emButton" id="emAddButton_'.$object_id.'" value="'.$lang['comment'].'" onclick="addEMComment(\''.$object_id.'\')" />
</span>
</form>
</div>';
//send reply to client
echo '<div id="'.$object_id.'" class="emComments" object="'.$object_id.'" class="ignorejsloader">'.$html.'</div>';
Trial/error is a way of learning. Try updating the width on the code below for instance:
.emAddComment textarea{
width: 50%;
height: 29px;
overflow: hidden;
margin: 0 10px 5px 0;
min-height: 29px;
border: 1px solid #BDC7D8;
font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
font-size: 11px;
padding: 3px;
}
Here is my site : rickymason.net/blurbs
If you take a look at it in chrome, you'll see that the AJAX on the right loads properly, and the CSS correctly formats it.
In firefox, its a different story. I've played around with it, but can't find the problem.
Here is my template(divs):
<html>
<head><?php echo $head; ?></head>
<div id="wrapper">
<div id="topnav"><?php echo $topnav; ?></div>
<div id="leftbar">
<?php echo $logo; ?>
<img src="<?php echo $profile['avatar_loc']['location'] ?>" alt="avatar_user"/>
<div id="select">
<?php echo $create; ?>
<div id="filter_select"><?php echo $category; ?></div>
<div id="addfilter"><?php echo $addfilter; ?></div>
</div>
</div>
<div id="boardwrapper">
<div id="boardborder">
<div id="board" alt="Welcome to Blurb!"><img src="img/board/loading.gif" alt="loading"/></div>
</div>
<div id="boardbot"></div>
</div>
<footer>
<?php echo $footer; ?>
</footer>
</body>
</div>
</html>
Here is my CSS
.board {
display: table;
padding-left: 35px;
padding-top: 10px;
}
.board #row {
padding-bottom: 15px;
}
.board #author p {
position: absolute;
top: inherit;
padding-left: 3px;
padding-top: 53px;
color: white;
font: 16px Tahoma, Helvetica, Arial, Sans-Serif;
text-align: center;
text-shadow: 0px 2px 3px #555;
}
.board #author {
display: table-cell;
border: 1px solid #97cae6;
width: 75px;
height: 75px;
}
.board #arrow {
background-image: url('../img/board/corner.jpg');
display: table-cell;
width: 35px;
height: 75px;
}
.board #subject {
position: relative;
max-height: 75px;
display: table-cell;
width: 653px;
max-width: 653px;
height: 75px;
border-top: 1px solid #97cae6;
border-bottom: 1px solid #97cae6;
}
.board #subject a {
position: absolute;
top: inherit;
padding-top: 18px;
}
.board #info {
display: table-cell;
width: 180px;
height: 75px;
border-top: 1px solid #97cae6;
border-bottom: 1px solid #97cae6;
border-right: 1px solid #97cae6;
border-top-right-radius: 20px;
border-bottom-right-radius: 20px;
}
Hopefully something jumps out at you and you can help! Thanks!
In the file board.css, changing this:
.board #arrow {
background-image: url('../img/board/corner.jpg');
display: table-cell;
width: 35px;
height: 75px;
}
to this:
.board #arrow {
background: url('../img/board/corner.jpg') no-repeat;
display: table-cell;
width: 35px;
}
Should fix your problem.
JA