如何用PHP修改CSS? [英] How to modify CSS with PHP?

查看:223
本文介绍了如何用PHP修改CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用PHP修改某个网页的背景图像?

我想要一个页面顶部的几个按钮,以便读者可以从2中选择

或3种不同的背景图像(或颜色),使页面更易于阅读。

我可以在不使用JavaScript的情况下使用这种动态HTML吗?如何修改我的

CSS?或者我只是将页面指向另一个样式表,仅用于

背景图像指令?

解决方案

< blockquote> deko写道:


是否可以修改某个网页的背景图片

with PHP?我想在页面顶部只有几个按钮,这样读者可以选择2或3个不同的背景图像(或颜色)来制作

页面更容易阅读。我可以使用JavaScript吗?没有

这样的动态HTML吗?如何修改我的CSS?或者我只是将页面

指向另一个样式表,仅用于background-image指令?



您可以指向不同的样式表 - 或者您只需包含一个

< style type =" text / css" > ...< / style为页面

标题中的背景图片。


-

= =================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


或者你只需​​要包含


< style type =" text / css"> ...< /在页面的

标题中为背景图像设置样式。



听起来比维护多个样式表更容易。


这个场景听起来是否正确:


在页面上放置HTML按钮,如下所示:


< form action =""方法= QUOT;交" name =" newbackground">

< input type =" submit" value =" white">

< input type =" submit" value =" yellow">

< / form>


然后,在页面的head部分,使用PHP如下:


< head>

< style type =" text / css">

<?php

if(!empty(


newbackground = trim(


Is it possible to modify the background-image for a certain web page with PHP?
I''d like to but a few buttons on the top of a page so readers can select from 2
or 3 different background images (or colors) to make the page easier to read.
Can I do this kind of Dynamic HTML without using JavaScript? How do I modify my
CSS? Or do I just point the page to a different stylesheet just for the
background-image directive?

解决方案

deko wrote:

Is it possible to modify the background-image for a certain web page
with PHP? I''d like to but a few buttons on the top of a page so readers
can select from 2 or 3 different background images (or colors) to make
the page easier to read. Can I do this kind of Dynamic HTML without
using JavaScript? How do I modify my CSS? Or do I just point the page
to a different stylesheet just for the background-image directive?

You can point to a different style sheet - or you can simply include a
<style type="text/css">... </stylefor the background image in the
header of the page.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


or you can simply include a

<style type="text/css">... </stylefor the background image in the
header of the page.

That sounds easier than maintaining multiple stylesheets.

Do this scenario sound correct:

Put HTML buttons on the page, something like this:

<form action="" method="post" name="newbackground">
<input type="submit" value="white">
<input type="submit" value="yellow">
</form>

Then, in the head section of the page, use PHP like this:

<head>
<style type="text/css">
<?php
if (!empty(


newbackground = trim(


这篇关于如何用PHP修改CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆