Search Results

Search found 2535 results on 102 pages for 'belongs on doctype'.

Page 2/102 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Why does the HTML5 DOCTYPE mess with my padding?

    - by Dakota
    I have an html5 page with a navbar. Completely scratch coded. I just recently added a doctype to the item, and now I’m getting extra space under my navbar. If I remove the doctype declaration, it goes back to normal. I have completely reset padding, margins, etc. on everything, and cut it down to the a small amount of code that illustrates the issue. The page can be seen at http://hackthetruth.org/webdesign/broken Does anyone know why declaring the doctype is messing with the height of a div?

    Read the article

  • Exclude category from Wordpress home page unless it belongs to another category

    - by sirlancelot
    I have multiple users adding content to restricted categories (using RoleScoper) in my Wordpress setup that don't show up on the homepage (custom template with query_posts()). I'm looking for a way to "promote" the submitted content to the homepage by adding it to another category. My loop code looks like this: <?php query_posts($query_string . '&cat=-37'); if (have_posts()): while (have_posts()): the_post(); ?> This will exclude all posts in category 37. However, even if I add the post to a different category it still gets excluded. Is there a way to exclude a post if it belongs to just that one category?

    Read the article

  • Going to IE8 with DOCTYPE HTML 4.01 Transitional any suggestions appeciated.

    - by Marco Demaio
    Hello, we use in all our pages in the 1st line of our HTML code the: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> We are moving on to the new IE8 and we would like to keep the DOCTYPE unchanged, is there any suggestions/warnings we better be aware of? I mean like: "Be careful that CSS min-width is not working anymore in IE8 transitional, be careful that it will screw up page in this and that, etc." Thanks!

    Read the article

  • Dependency injection: what belongs in the constructor?

    - by Adam Backstrom
    I'm evaluating my current PHP practices in an effort to write more testable code. Generally speaking, I'm fishing for opinions on what types of actions belong in the constructor. Should I limit things to dependency injection? If I do have some data to populate, should that happen via a factory rather than as constructor arguments? (Here, I'm thinking about my User class that takes a user ID and populates user data from the database during construction, which obviously needs to change in some way.) I've heard it said that "initialization" methods are bad, but I'm sure that depends on what exactly is being done during initialization. At the risk of getting too specific, I'll also piggyback a more detailed example onto my question. For a previous project, I built a FormField class (which handled field value setting, validation, and output as HTML) and a Model class to contain these fields and do a bit of magic to ease working with fields. FormField had some prebuilt subclasses, e.g. FormText (<input type="text">) and FormSelect (<select>). Model would be subclassed so that a specific implementation (say, a Widget) had its own fields, such as a name and date of manufacture: class Widget extends Model { public function __construct( $data = null ) { $this->name = new FormField('length=20&label=Name:'); $this->manufactured = new FormDate; parent::__construct( $data ); // set above fields using incoming array } } Now, this does violate some rules that I have read, such as "avoid new in the constructor," but to my eyes this does not seem untestable. These are properties of the object, not some black box data generator reading from an external source. Unit tests would progressively build up to any test of Widget-specific functionality, so I could be confident that the underlying FormFields were working correctly during the Widget test. In theory I could provide the Model with a FieldFactory() which could supply custom field objects, but I don't believe I would gain anything from this approach. Is this a poor assumption?

    Read the article

  • Netbeans - *Easy* way to tell which Netbeans project a file belongs to

    - by sdek
    I was wondering if there is a way in Netbeans (v 6.8, or whatever) to have the editor tabs colored based on which project the file belongs to? Or some other easy way to distinguish which project a file belongs to. Basically my problem is that I have 3-4 netbeans projects, which all have a very similar code base (production version, staging version, development version 1, development version 2), and sometimes I have files open from a few different projects, and I get confused as to which project the file belongs to. And I know that you can hover over the tab and you can see which project it belongs to, but it would be fantastic if there was another, easier way to visually distinguish which project a file belongs to.

    Read the article

  • Let a question always :include its author, how?

    - by Freewind
    class Question < ActiveRecord::Base belongs_to :author end class Author < ActiveRecord::Base has_many :questions end When I find some questions, I usually need to get their authors at the same time, so I use: Question.find(:all, :include=>:authors) But I don't write the ":include" part everywhere. I hope I can define the "include" somewhere only once, and when I find questions, the author will be automaticly loaded. Is there any way to do this?

    Read the article

  • PHP/MySQL: Check if something 'belongs-to' something else?

    - by Nebs
    I have two tables: Stores and Items. The relationship is: Stores 1---* Items In PHP/MySQL what would be the best (fastest/simplest) way to check if a particular item belongs to a particular store. In other words given for example: $store_id = 1; $item_id = 12; I want to check if item 12 belongs to store 1 (and not some other store). I usually do a select on Items matching both the store_id and item_id and limit the results to 1. Then check how many rows (0 or 1) were returned with mysql_num_rows. Is there a better way? Update: Both tables have an "id" column. The Items table has a "store_id" column.

    Read the article

  • Fullscreen HTML Element using window.innerHeight/Width different with DOCTYPE

    - by CryptoQuick
    I'm trying to make an HTML5 canvas element fullscreen with the window.innerHeight and innerWidth properties. Unfortunately, on Chrome 10, when I set use the following doctype: <!DOCTYPE HTML> ...there is some extra scrolling space indicated by scroll bars which shouldn't appear. Without a doctype, everything is fine. The element is an HTML5 canvas, so styling with 100% will only stretch the content. Is it worth using a doctype which breaks my functionality (without which might be bad?), or should I subtract, say, 15px from the values in order to keep scroll bars from appearing? (which is kludgy)

    Read the article

  • Create XML DocType element

    - by Moro
    Hi all, Please I am working with IBM message broker, and I want to know how to create (in java/esql) DOCTYPE element in a message as the following: <!DOCTYPE COMMAND PUBLIC "any//DTD any//EN" "xml/command.dtd"> <COMMAND> ...... <COMMAND> I tried: MbElement root = outMessage.getRootElement().getLastChild(); MbElement xmlDocType = root.createElementAsFirstChild(MbXMLNSC.DOCUMENT_TYPE); xmlDocType.setName("COMMAND PUBLIC"); xmlDocType.createElementAsLastChild(MbXMLNSC.Attribute, null, "any//DTD any//EN"); but no way :( it produces: <!DOCTYPE COMMAND PUBLIC []> <COMMAND> ...... <COMMAND> Thanks in advance,

    Read the article

  • Insert a doctype into an XML document (Java/ SAX)

    - by Thom Nichols
    Imagine you have an XML document and imagine you have the DTD but the document itself doesn't actually specify a DOCTYPE ... How would you insert the DOCTYPE declaration, preferably by specifying it on the parser (similar to how you can set the schema for a document that will be parsed) or by inserting the necessary SAX events via an XMLFilter or the like? I've found many references to EntityResolver, but that is what's invoked once a DOCTYPE is found during parsing and it's used to point to a local DTD file. EntityResolver2 appears to have what I'm looking for but I haven't found any examples of usage. This is the closest I've come thus far: (code is Groovy, but close enough that you should be able to understand it...) import org.xml.sax.* import org.xml.sax.ext.* import org.xml.sax.helpers.* class XmlFilter extends XMLFilterImpl { public XmlFilter( XMLReader reader ) { super(reader) } @Override public void startDocument() { super.startDocument() super.resolveEntity( null, 'file:///./entity.dtd') println "filter startDocument" } } class MyHandler extends DefaultHandler2 { public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) { println "entity: $name, $publicId, $baseURI, $systemId" return new InputSource(new StringReader('<!ENTITY asdf "&#161;">')) } } def handler = new MyHandler() def parser = XMLReaderFactory.createXMLReader() parser.setFeature 'http://xml.org/sax/features/use-entity-resolver2', true def filter = new XmlFilter( parser ) filter.setContentHandler( handler ) filter.setEntityResolver( handler ) filter.parse( new InputSource(new StringReader('''<?xml version="1.0" ?> <test>one &asdf; two! &nbsp; &iexcl;&pound;&cent;</test>''')) ); I see resolveEntity called but still hit org.xml.sax.SAXParseException: The entity "asdf" was referenced, but not declared. at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231) at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333) I guess this is because there's no way to add SAX events that the parser knows about, I can only add events via a filter that's upstream from the parser which are passed along to the ContentHandler. So the document has to be valid going into the XMLReader. Any way around this? I know I can modify the raw stream to add a doctype or possibly do a transform to set a DTD... Any other options?

    Read the article

  • DOCTYPE declaration getting lost when using XSL

    - by Rachel
    The input to my XSL is an XHTML. After applying the XSL the DOCTYPE declaration that was present in the input XHTML gets lost in the output. Do i have an option to copy/retain the DOCTYPE declaration in the output using XSL. The XSL processor that i am using is SAXON.

    Read the article

  • XSL Doctype Issue

    - by Batfan
    I'm having issues with an XSL template that is outputting to HTML. There is a javascript being rendered on the resulting HTML page that requires a strict doctype in order to work across all browsers. However, I cant get the doctype to show up. Any thoughts on this? Would it be possible to insert it dynamically, using javascript or php? Any help is appreciated.

    Read the article

  • How to view doctype in generated source code

    - by wcpro
    I am using an XSL transformation on an xml file to create an xml document. The problem i am running into is that when i go to view the generated source (the transformed source) i can't see the DOCTYPE attribute of the html so i don't know if its being emitted properly. Is there any way to view the doctype in this way?

    Read the article

  • Validate a belongs to association in a build situation.

    - by Victor Martins
    I have a Mission model that has_many Task, and the Task belongs_to Mission For security I've made this validation on the Task Model: validates_presence_of :mission_id validates_numericality_of :mission_id But the problem is that when create a Mission and add tasks like this: @mission.tasks.build The validation returns error, because the mission id on the task is null ( the mission wasn't yet created ) If I delete the validation, the Mission and Task is created successfuly, but how can I keep the validation and still have this work? I could do a callback after the save, but I don't think that's right, because I don't want to save Tasks without a mission_id. P.S. I'm hidding my mission field on the form. If I have it visible, it will show the currect mission and everything is ok. But if I hidde it the error happens. <%= f.hidden_field :mission, :label => "Missão" %> Is the form reseting the attributes given by the controller on the new action?

    Read the article

  • html doctype adds whitespace ??

    - by pstanton
    can someone please explain to me why having a doctype of <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> and <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> render the following block differently under firefox? <table style="border-collapse:collapse; margin:0; padding:0;"> <tr> <td style="border:1px solid red; margin:0; padding:0;"><img src="http://images.smh.com.au/2010/06/01/1533814/th_park-90x60.jpg" style="border:none; padding:0; margin:0;" /></td> </tr> </table> using 'Transitional', there is no white space below the image, using 'Strict' there is! 2nd question, using strict, is it at all possible to remove this whitespace?

    Read the article

  • HTML5 Doctype Support

    - by Metropolis
    Hey Everyone, For a long time I have been using XHTML1.1 because I thought I was cool (yeah right). However, today I read Ian Hickson's Article about how everyone uses the wrong MIME type with XHTML and it opened my eyes a lot. I happen to be one of those people who are serving XHTML with text/html MIME, because like a lot of people, W3C says its "ok" to serve it this way. At the top of that article he says that "now" he would serve it using the HTML5 doctype (!DOCTYPE HTML). What are your thoughts about doing this? If I did not use unsupported functionality, would it be ok? What would the MIME type be in this case? Thanks for any help, Metropolis

    Read the article

  • Remote access to phpmyadmin from computer belongs to same LAN

    - by Charles
    OK... I solved it. It is because I have not configured the httpd.conf to allow the centos listen port 80 and 8080. Listen 80 Listen 8080 I have setup the myphpadmin on my CentOS 6.4 recently. I can access and login to the myphpadmin on my localhost. However, when I type http://[hostipaddr]/phpmyadmin on my other computer in the same LAN with the CentOS, the browser simply cannot access the page. Below are some of the current configuration. Anyone can help please......? config.inc.php $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'http'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; /* Select mysql if your server does not have mysqli */ $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = false; phpmyadmin.conf <Directory /var/www/html/phpmyadmin/> order allow,deny allow from all </Directory> Furthermore, I can access the webpage that stored in the CentOS from my other computer without problems. After using wireshark and tcpdump, I found that the server (the Cent OS) keep resetting the connection. (192.168.1.106 is my other computer, 192.168.1.101 is my CentOS) 23:29:42.281473 IP 192.168.1.106.55999 > 192.168.1.101.webcache: Flags [S], seq 2559409090, win 65535, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0 23:29:42.281504 IP 192.168.1.101.webcache > 192.168.1.106.55999: Flags [R.], seq 0, ack 2559409091, win 0, length 0 I have disabled the iptables service on the CentOS already.

    Read the article

  • parameterized doctype in xsl:stylesheet

    - by Flavius
    How could I inject a --stringparam (xsltproc) into the DOCTYPE of a XSL stylesheet? The --stringparam is specified from the command line. I have several books in docbook5 format I want to process with the same customization layer, each book having an unique identifier, here "demo", so I'm running something like xsltproc --stringparam course.name demo ... for each book. Obviously the parameter is not recognized as such, but as verbatim text, giving the error: warning: failed to load external entity "http://edu.yet-another-project.com/course/$(course.name)/entities.ent" Here it is how I've tried, which won't work: <?xml version='1.0'?> <!DOCTYPE stylesheet [ <!ENTITY % myent SYSTEM "http://edu.yet-another-project.com/course/$(course.name)/entities.ent"> %myent; ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- the docbook template used --> <xsl:import href="http://docbook.org/ns/docbook/xhtml/chunk.xsl"/> <!-- processor parameters --> <xsl:param name="html.stylesheet">default.css</xsl:param> <xsl:param name="use.id.as.filename">1</xsl:param> <xsl:param name="chunker.output.encoding">UTF-8</xsl:param> <xsl:param name="chunker.output.indent">yes</xsl:param> <xsl:param name="navig.graphics">1</xsl:param> <xsl:param name="generate.revhistory.link">1</xsl:param> <xsl:param name="admon.graphics">1</xsl:param> <!-- here more stuff --> </xsl:stylesheet> Ideas?

    Read the article

  • vertical-align="middle" for td is not working if we use <!doctype ...>

    - by Manohar
    Hi, I am trying to middle align an element, But I have bumped into this problem. I am using this tag: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <body> <table style="width:100%; height: 100%" cellspacing="0" cellpadding="0"> <tr> <td vertical-align="middle"> <div id="progressContainer" style="text-align:center;"> Some string here </div> </td> </tr> </table> </body> </html> If I remove this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">, its middle aligned properly. Question: Am I doing anything wrong here?

    Read the article

  • IE layers issue when dtd with doctype tag is not added

    - by keshav.veerapaneni
    Hello colleagues, I am facing a very strange issue because of which when i do not add the below line to the html the layers(z-index) is not working. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"; "_http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Please let me know if you are aware of the issue and how to get layers working without adding this tag. Best Regards, Keshav

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >