Tag: css
Remove whitespace from wordpress tagcloud
I hate whitespace in html code: if I need them I'll use css rules.
so that's a simple plugin edited from this one.
if you need both merge them
-
<?php
-
/*
-
Plugin Name: Tag Cloud noWhitespace
-
Plugin URI: http://www.laboratoriocaffeina.it/design/2008/04/03/remove-whitespace-from-wordpress-tagcloud.html
-
Description: Makes wordpress dump out a tag cloud without whitespace between each word in tags (edit from http://www.185vfx.com/2007/10/wordpress-tag-cloud-formatting/)
-
Author: cedmax
-
Version: 1.0
-
Author URI: http://www.dioblog.it
-
*/
-
-
-
// This just echoes the chosen line, we'll position it later
-
function tci_kill_breaks($taglist) {
-
}
-
-
// Now we set that function up to execute when the tag list is generated
-
add_filter('wp_generate_tag_cloud', 'tci_kill_breaks',50);?>
download, rename to .php, upload to plugin folder and activate
(tested on 2.5)
Easy Clear #4, ovvero “e mò basta però”
dopo la terza puntata di easy clear mi sono accorto che non sempre funziona su ie6.
dramma e panico.
non vi preoccupate ho la soluzione:
la 3 prevedeva di mettere nel contenitore dei float il seguente codice
-
#wrapper {
-
overflow:hidden;
-
height:1%;
-
height:auto !important;
-
}
se non funziona su ie6 provate questo.
-
#wrapper {
-
overflow:hidden;
-
width:100%;
-
}
any feedback?
News Scroller
Ecco un piccolo esempio in cui si applicano le proprietà presentate in Scroll boxes. Si tratta di una possibile visualizzazione di news a scorrimento automatico in un blocco DIV. Niente di innovativo e tanto meno completo, ma può considerarsi uno buono spunto per esercitarsi con javascript, css e xhtml ( AJAX usando una sigla audace ).
Primo step, HTML formato da un contenitore generale un wrapper che servira' come contenitore delle news e quindi le singole news:
Secondo step,CSS che nasconde l'overflow delle news:
-
#container{
-
margin: 20px;
-
width: 200px;
-
height: 200px;
-
/*Nasconde la parte in eccesso*/
-
overflow: hidden;
-
border: 1px solid #000
-
}
-
-
div.news{
-
padding: 10px;
-
}
Ultimo step, Javascript per dare moto al tutto:
-
//dichiarazione variabili globali
-
var time;
-
var scroll_limit;
-
-
//Alcune impostazioni fondamentali pre caricamento pagina
-
function init(){
-
var container = document.getElementById("container");
-
var wrapper = document.getElementById("wrapper");
-
var client_height = container.offsetHeight;
-
var news_nodelist = wrapper.getElementsByTagName("DIV");
-
-
/**
-
* Lo scroller deve resettarsi quando gli attuali
-
* elementi news sono stati tutti scorsi.
-
**/
-
scroll_limit = wrapper.offsetHeight;
-
var i = 0;
-
var current_element = news_nodelist[i];
-
-
/**
-
* Si duplicano i nodi in modo da creare l'illusione
-
* dello scorrimento continuo. Si assume che ci siano
-
* abbastanza nodi (news) da duplicare.
-
**/
-
while(client_height>= 0){
-
var current_element = news_nodelist[i];
-
client_height = client_height - current_element.scrollHeight;
-
wrapper.appendChild(current_element.cloneNode(true));
-
i = i + 1;
-
}
-
scroll("wrapper");
-
}
-
function scroll(element_id){
-
var wrapper = document.getElementById(element_id);
-
var container = wrapper.parentNode;
-
var scroll_top = container.scrollTop;
-
if( scroll_top + 1 <scroll_limit ){
-
container.scrollTop = container.scrollTop + 1;
-
}else{
-
container.scrollTop = 0;
-
}
-
// Si richiama la funzione tra 25 millisecondi
-
time = setTimeout('scroll(\'wrapper\')', 25);
-
}
-
-
function stopScroll()
-
{
-
if (time) clearTimeout(time);
-
}
Ovviamente la funzione init() deve essere richiamata al termine del caricamento della pagina HTML, ora sta a voi raffinare questo rozzo esempio di News Scroller.
Testato su:
Firefox 2.0.0.3 (Linux)
Mozilla 1.7.13 (Linux)
Epiphany 2.16.1 (Linux)
Galeon 2.0.2 (Linux)
IE 6.0 (Linux)
Vertical Centering in CSS with Unknown Height (ie7 compatible)
This article of jakpsatweb about vertical alignment is really the only solution I found out about this issue.
I take the Structural solution without Hack as reference, most of all becouse when an hack is not strictly neccesary it's better to avoid it.
Yuhu's code is great.
-
#outer {
-
height: 400px;
-
overflow: hidden;
-
position: relative;
-
}
-
-
#outer[id] {
-
display: table;
-
position: static;
-
}
-
-
#middle {
-
position: absolute;
-
top: 50%;
-
} /* for explorer only*/
-
-
#middle[id] {
-
display: table-cell;
-
vertical-align: middle;
-
position: static;
-
}
-
-
#inner {
-
position: relative;
-
top: -50%
-
} /* for explorer only */
-
-
/* optional: #inner[id] {position: static;} */
but it's not working on ie7, that catches [id] selectors but behaves as ie6.
so what?
according to css selectors we should write those css line more
-
*:first-child+html #outer[id] {
-
position:relative
-
} /* for explorer 7 only */
-
-
*:first-child+html #middle[id] {
-
position: absolute;
-
display:block;
-
vertical-align:inherit;
-
top: 50%;
-
} /* for explorer 7 only */
-
-
/* optional: *:first-child+html #inner[id] {position: relative;} */
have fun :)
How to Create an Image Map Using CSS
Esistono vari modi per mappare un'immagine via CSS (aiutati qualche volta da JS), oggi ve ne segnalo alcuni... poi ognuno deciderà quale sia il migliore...
CSS Image Maps, Flickr-like Technique?
Tecnica proposta da Frank Manno basata sull'uso degli elementi DL, DT e DD via CSS e XHTML.
[...]a sample image map that's built entirely using CSS and XHTML. While I've added support for Javascript (item titles are simply displayed beneath the image), I've disabled it in this example -- I've run into a bit of a problem when JS is enabled and CSS is disabled (more details below).[...]
CSS Image Maps, Redux
Versione "redux" della precedente, sempre dello stesso autore e sempre CSS con XHTML.
[...]I went back to the drawing board, and came up with another solution that requires a single image, some CSS, and a little creativity! This second example makes use of transparent images (PNG images) to indicate an annotation on an image. Much of the same CSS from the first example was used, with a few minor alterations. Below is a sample of the old vs. [...]
CSS Image Map, by Moryson
Tecnica basata sull'uso delle liste non ordinale (UL) - CSS con XHTML. (sito e spiegazioni solo in tedesco)
Create a reactive zone (image map) with CSS
Tutorial che prende spunto da un vecchio articolo di A List Apart per poi proporre la propria soluzione via CSS e XHTML.
[...]It needs to be converted in block to go around that. There are only two possibilities to do that: display: block on the link (in this case, the image will need to be positionned) or float: left on the link, that will transform it in a block (that's the solution I went with)[...]
A List Apart: Articles: A More Accessible Map
Questa invece è una soluzione che sfrutta anche il JS accompagnato sempre da CSS e XHTML.
As companies like Google and Yahoo! have simplified the process of placing information on a map by offering web services/APIs, the popularity and abundance of mapping applications on the web has increased dramatically. While these maps have had a positive effect on most users, what does it mean for people with accessibility needs?[...]
How to Create an Image Map Using CSS
Tutorial fatto molto bene, con un'interessante soluzione finale, tutto via CSS e XHTML.
Here, you will learn one styling step at a time, fully explaining the reason for each style and showing the results of each step, so that you can see what to expect and implement it for yourself.
CSS: Map Pop
L'ultima soluzione che vi segnalo è davvero valida.
Image maps are cool. So are pop-ups. Here I combine the two into a single “Map Pop” experiment. Combining the two could be very useful to some people. Especially if you want a nicely interactive solution that just happens to be accessible to a vast number of users. In addition to its accessibility, based not on conjecture but on actual testing, this solutions seems to be supported by a large number of user agents, even Internet Explorer 6.x [...]
Ora non vi resta che provare, provare e provare... finchà© non troverete la soluzione che fa al caso vostro... buon lavoro.
Easy Clear #3, ovvero di come non si smette mai di imparare
Dopo la soluzione di ieri, impietrito da uno strano effetto proposto randomicamente da ie7 per cui compariva un margin bottom all'elemento esterno in float, sono andato in cerca di metodi alternativi.
Semplice quanto sconvolgente (mai ci avrei pensato): mettere un bel
-
#wrapper {
-
overflow:hidden;
-
height:1%;
-
height:auto !important;
-
}
senza float, al contrario di ieri, nè dimensioni fisse
il wrapper a questo punto miracolosamente si prenderà l'altezza giusta.
Easy Clear #2, ovvero di come non sapere le cose porta a complicarsi la vita
dopo l'articolo di ieri sull'easy clear di Position Everything ecco un metodo molto più semplice proposto da ordered list:
L'unico rischio è se si ha una struttura complessa e con molti elementi in float: potrebbe creare un po' di confusione e instabilità .
vedi anche easy clear #3

