Re: Re: PHP programming strategy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 07 Aug 2009 06:32:48 +0100, ash@xxxxxxxxxxxxxxxxxxxx (Ashley Sheridan) wrote:
.......
>> How, for example, could I otherwise achieved the following effect, which displays an image
>> with a border slightly darker than the background, and with the title and subtitle inside
>> the border?
>> 
>>    <table class="pfm">
>>       <tr>
>>         <td>
>>           <img src="Images/Nxxxxx.jpg" width="210" height="300">
>>           <p class="nrmltextn">Yanni Nxxxxx </p>
>>           <p class="notetextn">Sally Riordan Scholarship, 2007- </p>
>>           </td>
>>       </tr>
>>     </table>
>> 
........ 
>Well, your above example would just become:
>
><div class="pfm">
>    <img src="Images/Nxxxxx.jpg" width="210" height="300">
>    <p class="nrmltextn">Yanni Nxxxxx </p>
>    <p class="notetextn">Sally Riordan Scholarship, 2007- </p>
></div>
>
>Notice how the amount of code has dropped immediately! 

Yes - all of 22 bytes!

> From there, you
>can use CSS to target whatever element you need to within the .pfm
>class.

As I already do with the table. The divs look interesting, but the tables work, so I  will
look into them when everything else is fixed - if I am still alive!

>The images on your site would not had had titles if you'd omitted alt
>tags. Where would the browser find them from to display to a blind
>person?

The titles (eg Yanni xxxxx, above).

>True, CSS does not have constants, but that is why you create them to
>cascade, so that elements inherit features from their parents. A bit
>like classes in programming, where everything is either inherited from
>the parent object (tag) or overridden with a new style.

I can completely change the color scheme and appearance by loading a new definition file,
but this would be much simpler if I did not have to encode the values into the CSS:

  #bodystyle { <?php if ($bck_grd_img != '') 
	{ echo ('background-image:url('.$bck_grd_img.');'); }
	else { echo (' background-color:#'.$bdy_clr.';'); } ?> 
  font-family: "Times New Roman", Times, serif; color: #<?php echo ($txt_clr); ?>; 


>Also, if you're looking for diagnostics, give Firebug a try, as it
>really excels at this sort of thing. You can change styles on the fly
>from within the browser window, without needing to refresh the page!

Thanks, I will look into it.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux