Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Thread Tools Display Modes
Share |
Old 12-10-2015, 12:30 PM
xarzu's Avatar
xarzu xarzu is offline
Contributing Member
Join Date: 04-07-07
Posts: 50
iTrader: 0 / 0%
css with php

I uploaded a mod into my drupal based web site. But the format of the mod does not look so good and I want to use css to better format the content. This is what the mod looks like.


As you can see the column width is too narrow and the lines are wrapped in a horrible way. I would also like the liberty to have an authentic paypal button instead of this hyperlink (but we can address this later).

And this is what the php template code looks like :
PHP Code:
<form action="https://<?php echo variable_get('paypal_donations_service_url''www.sandbox.paypal.com'); ?>/cgi-bin/webscr" method="post" target="_blank" class="single-donation-form donation-form">
  <div class="inner_content" >
    <h3><?php echo t("Make " $variables['item_name']); ?></h3>
    <input name="landing_page" type="hidden" value="billing" />
    <input name="cpp_cart_border_color" type="hidden" value="FF0000" />
if(!empty($variables['top_logo'])) {
    <input name="cpp_header_image" type="hidden" value="<?php echo file_create_url($variables['top_logo']->uri, array('absolute' => TRUE))?>" />
?>    <input name="cpp_payflow_color" type="hidden" value="D20137" />
    <input name="business" type="hidden" value="<?php echo $variables['account_email']; ?>" />
    <input name="cmd" type="hidden" value="_donations" />
    <input type="hidden" name="notify_url" value="<?php echo $variables['notify_url']; ?>">
    <input type="hidden" name="return" value="<?php echo $variables['return_url']; ?>"/>
    <input name="item_name" type="hidden" value="<?php echo $variables['item_name']; ?>" />
    <ul class="column">
for($i $i count($variables['predefined_amounts']) ; $i++) {
'<li><input id="pre_single_' $i '" type="checkbox" class="donation-amount donation-single" value="' $variables['predefined_amounts'][$i] . '" /> <label for="pre_single_' $i '">' $variables['currency_sign'] . $variables['predefined_amounts'][$i] . '</label></li>';
      <?php if( $variables['custom_amount_allowed'] == ) { ?>
      <li class="last"><?php echo t('Other').": ".$variables['currency_sign']; ?><input name="other" size="4" type="text" value="" class="other" /></li>
      <?php ?>
      <input type="hidden" value="" name="amount" class="amount-holder"/>
    <input name="currency_code" type="hidden" value="<?php echo $variables['currency_code']; ?>" /><br />
  <a href="#" class="donation-submit-button"><?php echo t($variables['submit_value']); ?></a>
I have tried to solve this issue by adding a .css file by putting this line as the first line in the php file:

PHP Code:
<link rel="stylesheet" type="text/css" href="styles.css" /> 
and then, in the same directory, I have added the styles.css file which looks like this:
@charset "utf-8"; /* CSS Document */ .inner_content { width: 100%; margin:0 auto; text-align: center; } .inner_content.ul{ list-style:none; white-space: nowrap; } ul > li{ display: inline-block; } #column{ width:100%;}
But this did not work and the display is not changed.

Please Help.
Reply With Quote



Old 12-10-2015, 02:04 PM
ScriptMan's Avatar
ScriptMan ScriptMan is offline
Super Moderator
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,010
iTrader: 4 / 100%
Most of the CMS's that I've dealt with use templates for the html portion. I think Drupal does. If so you will have to do the linking from the template section.
Reply With Quote
Old 12-11-2015, 03:45 PM
J. H. Rasmussen J. H. Rasmussen is online now
Super Moderator
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 5,997
iTrader: 1 / 100%
Style is added to html elements in the order they are read, so if you want to overwrite some style classes, then you should add your css-file:
HTML Code:
<link rel="stylesheet" type="text/css" href="styles.css" />
as the last html-tag just before </head>.

Another possibility if you want to prevent overwriting of your style classes is to use !important, for example instead of writing:
HTML Code:
.inner_content { width: 100%; margin:0 auto; text-align: center; }
you can try to write:
HTML Code:
.inner_content { width: 100% !important; margin:0 auto !important; text-align: center !important; }
that should prevent other style classes from overwriting yours.
Reply With Quote
Old 01-17-2016, 04:33 PM
indexi indexi is offline
Contributing Member
Join Date: 03-21-07
Posts: 74
iTrader: 0 / 0%
float: left
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 09:43 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC