Solved

css formating

Posted on 2013-06-04
9
277 Views
Last Modified: 2013-06-05
I have the following php variable:

$sold= "<strong>&#62;&#62;&nbsp;SOLD</strong>";

If a record row is not empty the variable is correctly being shown on my web page:

<?php if (!empty($row_artGallery[artgal_stat])) {
      echo $space.$space.$sold; } ?>" />

I simple need to add a css style to this echo command such that the echoed value is RED in colour

On another note, please can someone tell me the correct css formating for Internet Explorer version 8 and above
to align div's and text left or centrally and to remove the border around images if they are hyperlinks. My css rules work perfectly in
Google chrome, Firefox and Safari but not in internet explorer
0
Comment
Question by:doctorbill
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 7

Assisted Solution

by:rgranlund
rgranlund earned 168 total points
ID: 39219536
The php should be what you want and the the two CSS classes should work on all browsers including IE.  The "Border None" is what takes off the hyperlink around the item in IE.
$sold="<span class='sold'>SOLD</span>";

<style>
.sold{
font-family:Ariel;
font-size:13px;
color:RED;
padding-left:10px;
}
.sold img {
border:none;
}
</style>

Open in new window

0
 
LVL 34

Assisted Solution

by:gr8gonzo
gr8gonzo earned 83 total points
ID: 39219544
I usually use <span> tags for adding CSS to specific words, like:

$sold = "<span style='color:#ff0000;'><strong>....</strong></span>";

Aligning DIVs and aligning text can be simple or complicated, depending on what you're trying to do. If you want to align the contents of a <div>, you would use the text-align CSS property. Aligning a <div> itself via CSS is often done by setting its "left" property, like left:50%.

Removing the border around linked images is accomplished by setting border=0 in the <img> tag.
0
 
LVL 82

Assisted Solution

by:hielo
hielo earned 83 total points
ID: 39219545
$sold= "<strong style='color:red;'>&#62;&#62;&nbsp;SOLD</strong>";

Open in new window

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 166 total points
ID: 39219763
If you use the HTML5 doctype declaration you will get better cooperation out of the IE browsers.  Here's an example of a PHP script that generates an HTML5 web page.
<?php // RAY_html5.php
error_reporting(E_ALL);

// CREATE VARIABLES FOR OUR HTML
$xyz = 'Hello World. ';


// CREATE OUR WEB PAGE IN HTML5 FORMAT
$htm = <<<HTML5
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="robots" content="index, follow" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<title>HTML5 Page in UTF-8 Encoding</title>
</head>
<body>
<p>$xyz</p>
</body>
</html>
HTML5;

// RENDER THE WEB PAGE
echo $htm;

Open in new window

0
 

Author Comment

by:doctorbill
ID: 39220146
This works:
---------------------------------------

$sold="<span class='sold'>SOLD</span>";

<style>
.sold{
font-family:Ariel;
font-size:13px;
color:RED;
padding-left:10px;
}
.sold img {
border:none;
}
</style>
---------------------------------------
I have just realised I need to also echo out an image in the same way - I presume I need to use img src tag ?
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 166 total points
ID: 39220502
Yes, the <img> tag would be appropriate for rendering an image.
http://www.w3schools.com/tags/tag_img.asp
0
 
LVL 7

Accepted Solution

by:
rgranlund earned 168 total points
ID: 39220631
<?php
$sold="<span class='sold'>SOLD</span>";
$image="<div class='image'><img src='SOURCE'/></div>";

echo $image;
echo $sold;
?>

<style>
.sold{
font-family:Ariel;
font-size:13px;
color:RED;
padding-left:10px;
}
.sold img {
border:none;
}

.image{
width:100px;
height:100px;
}
.image img {
border:none;
}
</style>

Open in new window

0
 

Author Comment

by:doctorbill
ID: 39221372
I've requested that this question be closed as follows:

Accepted answer: 83 points for rgranlund's comment #a39220631
Assisted answer: 84 points for rgranlund's comment #a39219536
Assisted answer: 84 points for gr8gonzo's comment #a39219544
Assisted answer: 83 points for hielo's comment #a39219545
Assisted answer: 83 points for Ray_Paseur's comment #a39219763
Assisted answer: 0 points for doctorbill's comment #a39220146
Assisted answer: 83 points for Ray_Paseur's comment #a39220502

for the following reason:

As usual - solution
0
 

Author Closing Comment

by:doctorbill
ID: 39221373
Solution
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question