Skip to main content

All Questions

Tagged with
1725 votes
30 answers
959k views

How Can I add HTML And CSS Into PDF [closed]

I have an HTML (not XHTML) document that renders fine in Firefox 3 and IE 7. It uses fairly basic CSS to style it and renders fine in HTML. I'm now after a way of converting it to PDF. I have tried:...
79 votes
11 answers
292k views

how to get the base url in javascript

I am building a website with CodeIgniter, I have various resources that I load with the base_url helper function like this <link rel="stylesheet" type="text/css" href="'.base_url('assets/css/...
Nehemias Herrera's user avatar
69 votes
15 answers
85k views

How to wrap long lines without spaces in HTML?

If a user types in a long line without any spaces or white space, it will break formating by going wider than the current element. Something like: HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA.............
Chris Bartow's user avatar
66 votes
7 answers
55k views

How to generate lighter/darker color with PHP?

I have a hex value of some color, for example #202010. How to generate a new color which is either lighter or darker given in percent (ie. 20% darker) in PHP?
eni's user avatar
  • 695
57 votes
6 answers
21k views

Multiple javascript/css files: best practices?

I have about 7 Javascript files now (thanks to various jQuery plugins) and 4-5 CSS files. I'm curious as to what's the best practice for dealing with these including where in the document they should ...
cletus's user avatar
  • 622k
56 votes
5 answers
2k views

How to draw a shape using a piece of image in php

I need to create a frame image by using a piece of an image. For Example: User will upload a image piece from back-end: Now I need to create a frame on front-end as per the front-end user's ...
Anshul Mishra's user avatar
40 votes
17 answers
460k views

How to import/include a CSS file using PHP code and not HTML code?

I have googled a lot but it seems that I am doing something wrong. I want to do this: <?php include 'header.php'; include'CSS/main.css'; ... ?> However, my page prints the CSS code. Note: I ...
Shailen TJ's user avatar
36 votes
15 answers
54k views

Remove whitespace from HTML

I have HTML code like: <div class="wrap"> <div> <div id="hmenus"> <div class="nav mainnavs"> <ul> <li>&...
James's user avatar
  • 43.2k
33 votes
3 answers
124k views

Styling a disabled input with css only

I have sort of a strange situation. I'm trying to style a disabled input button because I have an annoying hover turning the text to white. This makes it confusing to the user because its acting like ...
zazvorniki's user avatar
  • 3,591
31 votes
6 answers
128k views

PHP - Check if the page run on Mobile or Desktop browser [duplicate]

In my PHP page I should display two different text contents according to whether the page run under mobile or desktop browser. Is there a way to perform this control in PHP?
stacker's user avatar
  • 613
30 votes
3 answers
70k views

dompdf HTML to PDF - can't set margin of page

version: 0.6.0 beta 3 I tryed in every manner to make dompdf set the margin of the page. I have a long page with a lot of text, divided in chapters... my css is something like: #wrapper{ ...
Nereo Costacurta's user avatar
28 votes
2 answers
18k views

Multiple class attributes in HTML

What happens when an element has multiple class attributes? <div id="test" class="one two three" class="four"> I'm trying to add a class to the output of post_class(); in a WordPress plugin, ...
RichardTheKiwi's user avatar
26 votes
19 answers
54k views

Easiest way to alternate row colors in PHP/HTML?

Here's a PHP example of mine. Can anyone find a shorter/easier way to do this? <? foreach($posts as $post){?> <div class="<?=($c++%2==1)?‘odd’:NULL?>"> <?=$post?> ...
thrashr888's user avatar
  • 1,477
25 votes
2 answers
101k views

How do I convert my entire div data into image and save it into directory without using canvas?

i have already created my data (template-containing image,text,label etc) inside div now i want to convert it into image format. is there any technique to convert a specific div content into images ...
luckyamit's user avatar
  • 749
22 votes
8 answers
65k views

PHP E-mail Form Sender Name Instead Of E-mail?

Right now, I've set up a PHP e-mail form and everything works fine. However, while testing it, I'm only getting the sender e-mail address as the name. What I want is the name of the sender, like: ...
DearRicky's user avatar
  • 402

15 30 50 per page
1
2 3 4 5
974